added gradient in palette
This commit is contained in:
parent
24f36b2732
commit
393556a265
|
@ -36,27 +36,30 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Palette struct {
|
type Palette struct {
|
||||||
ContentColors []ui.Color
|
ContentColors []ui.Color
|
||||||
BaseColor ui.Color
|
GradientColors []ui.Color
|
||||||
MediumColor ui.Color
|
BaseColor ui.Color
|
||||||
ReverseColor ui.Color
|
MediumColor ui.Color
|
||||||
|
ReverseColor ui.Color
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPalette(theme Theme) Palette {
|
func GetPalette(theme Theme) Palette {
|
||||||
switch theme {
|
switch theme {
|
||||||
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},
|
||||||
BaseColor: ColorWhite,
|
GradientColors: []ui.Color{39, 44, 47, 82, 148, 185, 208, 203, 198, 196},
|
||||||
MediumColor: ColorDarkGrey,
|
BaseColor: ColorWhite,
|
||||||
ReverseColor: ColorBlack,
|
MediumColor: ColorDarkGrey,
|
||||||
|
ReverseColor: ColorBlack,
|
||||||
}
|
}
|
||||||
case ThemeLight:
|
case ThemeLight:
|
||||||
return Palette{
|
return Palette{
|
||||||
ContentColors: []ui.Color{ColorBlack, ColorDarkRed, ColorBlueViolet, ColorGrey, ColorGreen},
|
ContentColors: []ui.Color{ColorBlack, ColorDarkRed, ColorBlueViolet, ColorGrey, ColorGreen},
|
||||||
BaseColor: ColorBlack,
|
GradientColors: []ui.Color{250, 248, 246, 244, 242, 240, 238, 236, 234, 232},
|
||||||
MediumColor: ColorLightGrey,
|
BaseColor: ColorBlack,
|
||||||
ReverseColor: ColorWhite,
|
MediumColor: ColorLightGrey,
|
||||||
|
ReverseColor: ColorWhite,
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("Following theme is not supported: %v", theme))
|
panic(fmt.Sprintf("Following theme is not supported: %v", theme))
|
||||||
|
|
1
main.go
1
main.go
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue