From 393556a26581c7add2d8cc88830e7ba72e4827ee Mon Sep 17 00:00:00 2001 From: sqshq Date: Thu, 28 Mar 2019 19:56:46 -0400 Subject: [PATCH] added gradient in palette --- console/palette.go | 27 +++++++++++++++------------ main.go | 1 - 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/console/palette.go b/console/palette.go index 0eeefee..169b6db 100644 --- a/console/palette.go +++ b/console/palette.go @@ -36,27 +36,30 @@ const ( ) type Palette struct { - ContentColors []ui.Color - BaseColor ui.Color - MediumColor ui.Color - ReverseColor ui.Color + ContentColors []ui.Color + GradientColors []ui.Color + BaseColor ui.Color + MediumColor ui.Color + ReverseColor ui.Color } func GetPalette(theme Theme) Palette { switch theme { case ThemeDark: return Palette{ - ContentColors: []ui.Color{ColorOlive, ColorDeepSkyBlue, ColorDeepPink, ColorWhite, ColorGrey, ColorGreen, ColorOrange, ColorCian, ColorPurple}, - BaseColor: ColorWhite, - MediumColor: ColorDarkGrey, - ReverseColor: ColorBlack, + 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, + MediumColor: ColorDarkGrey, + ReverseColor: ColorBlack, } case ThemeLight: return Palette{ - ContentColors: []ui.Color{ColorBlack, ColorDarkRed, ColorBlueViolet, ColorGrey, ColorGreen}, - BaseColor: ColorBlack, - MediumColor: ColorLightGrey, - ReverseColor: ColorWhite, + ContentColors: []ui.Color{ColorBlack, ColorDarkRed, ColorBlueViolet, ColorGrey, ColorGreen}, + GradientColors: []ui.Color{250, 248, 246, 244, 242, 240, 238, 236, 234, 232}, + BaseColor: ColorBlack, + MediumColor: ColorLightGrey, + ReverseColor: ColorWhite, } default: panic(fmt.Sprintf("Following theme is not supported: %v", theme)) diff --git a/main.go b/main.go index f5fbf24..37781b9 100644 --- a/main.go +++ b/main.go @@ -52,7 +52,6 @@ func main() { } for _, c := range cfg.SparkLines { - println(c.Title) cpt := sparkline.NewSparkLine(c, palette) starter.start(cpt, cpt.Consumer, c.ComponentConfig, []config.Item{c.Item}, c.Triggers) }