Beveled is now structured like QuadBeveled

This commit is contained in:
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)
}