Themeing tweaks

This commit is contained in:
Sasha Koshka 2023-01-30 17:57:24 -05:00
parent 58c3b23a99
commit 6b19d66067
3 changed files with 54 additions and 30 deletions

View File

@ -7,28 +7,38 @@ var listPattern = artist.NewMultiBordered (
artist.Stroke {
Weight: 1,
Pattern: artist.Beveled {
artist.NewUniform(hex(0x383C3AFF)),
artist.NewUniform(hex(0x999C99FF)),
uhex(0x383C3AFF),
uhex(0x999C99FF),
},
},
artist.Stroke { Pattern: artist.NewUniform(hex(0x999C99FF)) })
artist.Stroke { Pattern: uhex(0x999C99FF) })
var selectedListPattern = artist.NewMultiBordered (
var focusedListPattern = artist.NewMultiBordered (
artist.Stroke { Weight: 1, Pattern: strokePattern },
artist.Stroke { Weight: 1, Pattern: accentPattern },
artist.Stroke { Pattern: artist.NewUniform(hex(0x999C99FF)) })
artist.Stroke { Pattern: uhex(0x999C99FF) })
// TODO: make these better, making use of the padded pattern. also, create
// selected variations for both of these.
var listEntryPattern = artist.Padded {
Stroke: uhex(0x383C3AFF),
Fill: uhex(0x999C99FF),
Sides: []int { 0, 0, 0, 1 },
}
var listEntryPattern = artist.NewMultiBordered (
artist.Stroke { Pattern: artist.NewUniform(hex(0x999C99FF)) })
var onListEntryPattern = artist.Padded {
Stroke: uhex(0x383C3AFF),
Fill: uhex(0x6e8079FF),
Sides: []int { 0, 0, 0, 1 },
}
var onListEntryPattern = artist.NewMultiBordered (
artist.Stroke { Pattern: artist.NewUniform(hex(0x6e8079FF)) })
var focusedListEntryPattern = artist.Padded {
Stroke: accentPattern,
Fill: uhex(0x999C99FF),
Sides: []int { 0, 1, 0, 1 },
}
var selectedListEntryPattern = artist.NewMultiBordered (
artist.Stroke { Pattern: artist.NewUniform(hex(0x999C99FF)) })
var focusedOnListEntryPattern = artist.Padded {
Stroke: accentPattern,
Fill: uhex(0x6e8079FF),
Sides: []int { 0, 1, 0, 1 },
}
var selectedOnListEntryPattern = artist.NewMultiBordered (
artist.Stroke { Pattern: artist.NewUniform(hex(0x6e8079FF)) })

View File

@ -134,27 +134,32 @@ func InputPattern (state PatternState) (pattern artist.Pattern, inset Inset) {
// ListPattern returns a background pattern for a list of things.
func ListPattern (state PatternState) (pattern artist.Pattern, inset Inset) {
if state.Focused {
return selectedListPattern, Inset { 4, 4, 4, 4 }
pattern = focusedListPattern
inset = Inset { 2, 1, 2, 1 }
} else {
return listPattern, Inset { 4, 4, 4, 4 }
pattern = listPattern
inset = Inset { 2, 1, 1, 1 }
}
return
}
// ItemPattern returns a background pattern for a list item.
func ItemPattern (state PatternState) (pattern artist.Pattern, inset Inset) {
if state.Focused {
if state.On {
return selectedOnListEntryPattern, Inset { 4, 4, 4, 4 }
pattern = focusedOnListEntryPattern
} else {
return selectedListEntryPattern, Inset { 4, 4, 4, 4 }
pattern = focusedListEntryPattern
}
} else {
if state.On {
return onListEntryPattern, Inset { 4, 4, 4, 4 }
pattern = onListEntryPattern
} else {
return listEntryPattern, Inset { 4, 4, 4, 4 }
pattern = listEntryPattern
}
}
inset = Inset { 4, 6, 4, 6 }
return
}
// ButtonPattern returns a pattern to be displayed on buttons.

View File

@ -16,6 +16,10 @@ func hex (color uint32) (c color.RGBA) {
return
}
func uhex (color uint32) (pattern artist.Pattern) {
return artist.NewUniform(hex(color))
}
var accentPattern = artist.NewUniform(hex(0x408090FF))
var backgroundPattern = artist.NewUniform(color.Gray16 { 0xAAAA })
var foregroundPattern = artist.NewUniform(color.Gray16 { 0x0000 })
@ -42,15 +46,20 @@ var texturedSunkenPattern = artist.NewMultiBordered (
artist.NewUniform(hex(0x97a09cFF)),
},
},
artist.Stroke { Pattern: artist.Striped {
First: artist.Stroke {
Weight: 2,
Pattern: artist.NewUniform(hex(0x97a09cFF)),
},
Second: artist.Stroke {
Weight: 1,
Pattern: artist.NewUniform(hex(0x6e8079FF)),
},
// artist.Stroke { Pattern: artist.Striped {
// First: artist.Stroke {
// Weight: 2,
// Pattern: artist.NewUniform(hex(0x97a09cFF)),
// },
// Second: artist.Stroke {
// Weight: 1,
// Pattern: artist.NewUniform(hex(0x6e8079FF)),
// },
// }})
artist.Stroke { Pattern: artist.Noisy {
Low: artist.NewUniform(hex(0x97a09cFF)),
High: artist.NewUniform(hex(0x6e8079FF)),
}})
var raisedPattern = artist.NewMultiBordered (