Beveled is now structured like QuadBeveled

This commit is contained in:
Sasha Koshka 2023-01-24 00:02:11 -05:00
parent 810728a479
commit 31a261d530
7 changed files with 33 additions and 36 deletions

View File

@ -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)
}

View File

@ -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))

View File

@ -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)) })

View File

@ -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)) })

View File

@ -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)) })

View File

@ -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)) },

View File

@ -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 },