Added more colors

This commit is contained in:
Sasha Koshka 2023-04-02 01:56:19 -04:00
parent bd636eaa7f
commit e9dff8ad07
2 changed files with 47 additions and 11 deletions

View File

@ -239,15 +239,30 @@ func (Default) Pattern (id tomo.Pattern, state tomo.State, c tomo.Case) artist.P
}
func (Default) Color (id tomo.Color, state tomo.State, c tomo.Case) color.RGBA {
if state.Disabled {
return artist.Hex(0x444444FF)
} else {
switch id {
case tomo.ColorAccent: return artist.Hex(0x408090FF)
case tomo.ColorForeground: return artist.Hex(0x000000FF)
default: return artist.Hex(0x888888FF)
}
}
if state.Disabled { return artist.Hex(0x444444FF) }
return artist.Hex (map[tomo.Color] uint32 {
tomo.ColorBlack: 0x000000FF,
tomo.ColorRed: 0x880000FF,
tomo.ColorGreen: 0x008800FF,
tomo.ColorYellow: 0x888800FF,
tomo.ColorBlue: 0x000088FF,
tomo.ColorPurple: 0x880088FF,
tomo.ColorCyan: 0x008888FF,
tomo.ColorWhite: 0x888888FF,
tomo.ColorBrightBlack: 0x888888FF,
tomo.ColorBrightRed: 0xFF0000FF,
tomo.ColorBrightGreen: 0x00FF00FF,
tomo.ColorBrightYellow: 0xFFFF00FF,
tomo.ColorBrightBlue: 0x0000FFFF,
tomo.ColorBrightPurple: 0xFF00FFFF,
tomo.ColorBrightCyan: 0x00FFFFFF,
tomo.ColorBrightWhite: 0xFFFFFFFF,
tomo.ColorForeground: 0x000000FF,
tomo.ColorBackground: 0xAAAAAAFF,
tomo.ColorAccent: 0x408090FF,
} [id])
}
// Padding returns the default padding value for the given pattern.

View File

@ -55,11 +55,32 @@ type Pattern int; const (
// Color lits a number of cannonical colors, each with its own ID.
type Color int; const (
// ColorAccent is the accent color of the theme.
ColorAccent Color = iota
// The sixteen ANSI terminal colors:
ColorBlack Color = iota
ColorRed
ColorGreen
ColorYellow
ColorBlue
ColorPurple
ColorCyan
ColorWhite
ColorBrightBlack
ColorBrightRed
ColorBrightGreen
ColorBrightYellow
ColorBrightBlue
ColorBrightPurple
ColorBrightCyan
ColorBrightWhite
// ColorForeground is the text/icon color of the theme.
ColorForeground
// ColorBackground is the background color of the theme.
ColorBackground
// ColorAccent is the accent color of the theme.
ColorAccent
)
// Icon lists a number of cannonical icons, each with its own ID.