added gradient in palette

This commit is contained in:
sqshq 2019-03-28 19:56:46 -04:00
parent 24f36b2732
commit 393556a265
2 changed files with 15 additions and 13 deletions

View File

@ -37,6 +37,7 @@ const (
type Palette struct { type Palette struct {
ContentColors []ui.Color ContentColors []ui.Color
GradientColors []ui.Color
BaseColor ui.Color BaseColor ui.Color
MediumColor ui.Color MediumColor ui.Color
ReverseColor ui.Color ReverseColor ui.Color
@ -47,6 +48,7 @@ func GetPalette(theme Theme) Palette {
case ThemeDark: case ThemeDark:
return Palette{ return Palette{
ContentColors: []ui.Color{ColorOlive, ColorDeepSkyBlue, ColorDeepPink, ColorWhite, ColorGrey, ColorGreen, ColorOrange, ColorCian, ColorPurple}, ContentColors: []ui.Color{ColorOlive, ColorDeepSkyBlue, ColorDeepPink, ColorWhite, ColorGrey, ColorGreen, ColorOrange, ColorCian, ColorPurple},
GradientColors: []ui.Color{39, 44, 47, 82, 148, 185, 208, 203, 198, 196},
BaseColor: ColorWhite, BaseColor: ColorWhite,
MediumColor: ColorDarkGrey, MediumColor: ColorDarkGrey,
ReverseColor: ColorBlack, ReverseColor: ColorBlack,
@ -54,6 +56,7 @@ func GetPalette(theme Theme) Palette {
case ThemeLight: case ThemeLight:
return Palette{ return Palette{
ContentColors: []ui.Color{ColorBlack, ColorDarkRed, ColorBlueViolet, ColorGrey, ColorGreen}, ContentColors: []ui.Color{ColorBlack, ColorDarkRed, ColorBlueViolet, ColorGrey, ColorGreen},
GradientColors: []ui.Color{250, 248, 246, 244, 242, 240, 238, 236, 234, 232},
BaseColor: ColorBlack, BaseColor: ColorBlack,
MediumColor: ColorLightGrey, MediumColor: ColorLightGrey,
ReverseColor: ColorWhite, ReverseColor: ColorWhite,

View File

@ -52,7 +52,6 @@ func main() {
} }
for _, c := range cfg.SparkLines { for _, c := range cfg.SparkLines {
println(c.Title)
cpt := sparkline.NewSparkLine(c, palette) cpt := sparkline.NewSparkLine(c, palette)
starter.start(cpt, cpt.Consumer, c.ComponentConfig, []config.Item{c.Item}, c.Triggers) starter.start(cpt, cpt.Consumer, c.ComponentConfig, []config.Item{c.Item}, c.Triggers)
} }