From 31a261d530f4b859e1c5dec32dfce890e0997573 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 24 Jan 2023 00:02:11 -0500 Subject: [PATCH] Beveled is now structured like QuadBeveled --- artist/chisel.go | 13 +++++-------- elements/testing/artist.go | 4 ++-- theme/button.go | 16 ++++++++-------- theme/input.go | 4 ++-- theme/list.go | 8 ++++---- theme/scroll.go | 12 ++++++------ theme/theme.go | 12 ++++++------ 7 files changed, 33 insertions(+), 36 deletions(-) diff --git a/artist/chisel.go b/artist/chisel.go index e1d3406..c902002 100644 --- a/artist/chisel.go +++ b/artist/chisel.go @@ -3,18 +3,15 @@ package artist import "image/color" // Beveled is a pattern that has a highlight section and a shadow section. -type Beveled struct { - Highlight Pattern - Shadow Pattern -} +type Beveled [2]Pattern // AtWhen satisfies the Pattern interface. func (pattern Beveled) AtWhen (x, y, width, height int) (c color.RGBA) { return QuadBeveled { - pattern.Highlight, - pattern.Shadow, - pattern.Shadow, - pattern.Highlight, + pattern[0], + pattern[1], + pattern[1], + pattern[0], }.AtWhen(x, y, width, height) } diff --git a/elements/testing/artist.go b/elements/testing/artist.go index dfd2b77..7ca65ce 100644 --- a/elements/testing/artist.go +++ b/elements/testing/artist.go @@ -36,8 +36,8 @@ func (element *Artist) Resize (width, height int) { artist.FillRectangle ( element, artist.Beveled { - Highlight: artist.NewUniform(hex(0xFF0000FF)), - Shadow: artist.NewUniform(hex(0x0000FFFF)), + artist.NewUniform(hex(0xFF0000FF)), + artist.NewUniform(hex(0x0000FFFF)), }, element.cellAt(0, 0)) diff --git a/theme/button.go b/theme/button.go index 78b7fe1..a492ff8 100644 --- a/theme/button.go +++ b/theme/button.go @@ -7,8 +7,8 @@ var buttonPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0xCCD5D2FF)), - Shadow: artist.NewUniform(hex(0x4B5B59FF)), + artist.NewUniform(hex(0xCCD5D2FF)), + artist.NewUniform(hex(0x4B5B59FF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0x8D9894FF)) }) @@ -17,8 +17,8 @@ var selectedButtonPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0xCCD5D2FF)), - Shadow: artist.NewUniform(hex(0x4B5B59FF)), + artist.NewUniform(hex(0xCCD5D2FF)), + artist.NewUniform(hex(0x4B5B59FF)), }, }, artist.Stroke { Weight: 1, Pattern: accentPattern }, @@ -28,8 +28,8 @@ var pressedButtonPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0x4B5B59FF)), - Shadow: artist.NewUniform(hex(0x8D9894FF)), + artist.NewUniform(hex(0x4B5B59FF)), + artist.NewUniform(hex(0x8D9894FF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0x8D9894FF)) }) @@ -38,8 +38,8 @@ var pressedSelectedButtonPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0x4B5B59FF)), - Shadow: artist.NewUniform(hex(0x8D9894FF)), + artist.NewUniform(hex(0x4B5B59FF)), + artist.NewUniform(hex(0x8D9894FF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0x8D9894FF)) }) diff --git a/theme/input.go b/theme/input.go index 6cdebd6..67aaa89 100644 --- a/theme/input.go +++ b/theme/input.go @@ -7,8 +7,8 @@ var inputPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0x89925AFF)), - Shadow: artist.NewUniform(hex(0xD2CB9AFF)), + artist.NewUniform(hex(0x89925AFF)), + artist.NewUniform(hex(0xD2CB9AFF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0xD2CB9AFF)) }) diff --git a/theme/list.go b/theme/list.go index 52f22a8..7e1acd8 100644 --- a/theme/list.go +++ b/theme/list.go @@ -7,8 +7,8 @@ var listPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0x383C3AFF)), - Shadow: artist.NewUniform(hex(0x999C99FF)), + artist.NewUniform(hex(0x383C3AFF)), + artist.NewUniform(hex(0x999C99FF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0x999C99FF)) }) @@ -28,8 +28,8 @@ var selectedListEntryPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0x3b534eFF)), - Shadow: artist.NewUniform(hex(0x97a09cFF)), + artist.NewUniform(hex(0x3b534eFF)), + artist.NewUniform(hex(0x97a09cFF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0x97a09cFF)) }) diff --git a/theme/scroll.go b/theme/scroll.go index 425cc11..b3ae4eb 100644 --- a/theme/scroll.go +++ b/theme/scroll.go @@ -7,8 +7,8 @@ var scrollGutterPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0x3b534eFF)), - Shadow: artist.NewUniform(hex(0x6e8079FF)), + artist.NewUniform(hex(0x3b534eFF)), + artist.NewUniform(hex(0x6e8079FF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0x6e8079FF)) }) @@ -20,8 +20,8 @@ var scrollBarPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0xCCD5D2FF)), - Shadow: artist.NewUniform(hex(0x4B5B59FF)), + artist.NewUniform(hex(0xCCD5D2FF)), + artist.NewUniform(hex(0x4B5B59FF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0x8D9894FF)) }) @@ -30,8 +30,8 @@ var pressedScrollBarPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0xCCD5D2FF)), - Shadow: artist.NewUniform(hex(0x4B5B59FF)), + artist.NewUniform(hex(0xCCD5D2FF)), + artist.NewUniform(hex(0x4B5B59FF)), }, }, artist.Stroke { Weight: 1, Pattern: artist.NewUniform(hex(0x8D9894FF)) }, diff --git a/theme/theme.go b/theme/theme.go index 24e5f31..923b5e2 100644 --- a/theme/theme.go +++ b/theme/theme.go @@ -28,8 +28,8 @@ var sunkenPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0x3b534eFF)), - Shadow: artist.NewUniform(hex(0x97a09cFF)), + artist.NewUniform(hex(0x3b534eFF)), + artist.NewUniform(hex(0x97a09cFF)), }, }, // artist.Stroke { Pattern: artist.NewUniform(hex(0x97a09cFF)) }, @@ -49,8 +49,8 @@ var raisedPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0xDBDBDBFF)), - Shadow: artist.NewUniform(hex(0x383C3AFF)), + artist.NewUniform(hex(0xDBDBDBFF)), + artist.NewUniform(hex(0x383C3AFF)), }, }, artist.Stroke { Pattern: artist.NewUniform(hex(0xAAAAAAFF)) }) @@ -60,8 +60,8 @@ var selectedRaisedPattern = artist.NewMultiBordered ( artist.Stroke { Weight: 1, Pattern: artist.Beveled { - Highlight: artist.NewUniform(hex(0xDBDBDBFF)), - Shadow: artist.NewUniform(hex(0x383C3AFF)), + artist.NewUniform(hex(0xDBDBDBFF)), + artist.NewUniform(hex(0x383C3AFF)), }, }, artist.Stroke { Weight: 1, Pattern: accentPattern },