2019-02-02 04:39:34 +00:00
|
|
|
package console
|
2019-01-31 23:40:05 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
ui "github.com/sqshq/termui"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Theme string
|
|
|
|
|
|
|
|
const (
|
|
|
|
ThemeDark Theme = "dark"
|
|
|
|
ThemeLight Theme = "light"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
ColorOlive ui.Color = 178
|
|
|
|
ColorDeepSkyBlue ui.Color = 39
|
2019-02-12 03:49:57 +00:00
|
|
|
ColorDeepPink ui.Color = 198
|
2019-02-17 03:18:12 +00:00
|
|
|
ColorCian ui.Color = 43
|
|
|
|
ColorOrange ui.Color = 166
|
|
|
|
ColorPurple ui.Color = 129
|
|
|
|
ColorGreen ui.Color = 64
|
2019-03-08 04:04:46 +00:00
|
|
|
ColorDarkGrey ui.Color = 235
|
2019-02-25 00:08:36 +00:00
|
|
|
ColorGrey ui.Color = 242
|
|
|
|
ColorWhite ui.Color = 15
|
2019-02-11 02:51:55 +00:00
|
|
|
ColorBlack ui.Color = 0
|
2019-02-25 00:08:36 +00:00
|
|
|
ColorClear ui.Color = -1
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2019-03-08 04:04:46 +00:00
|
|
|
MenuColorBackground ui.Color = 235
|
2019-02-25 00:08:36 +00:00
|
|
|
MenuColorText ui.Color = 255
|
2019-01-31 23:40:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Palette struct {
|
|
|
|
Colors []ui.Color
|
2019-02-05 03:26:00 +00:00
|
|
|
// TODO Menu colors, like Dark, Medium, Light etc
|
2019-01-31 23:40:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetPalette(theme Theme) Palette {
|
|
|
|
switch theme {
|
|
|
|
case ThemeDark:
|
2019-03-01 03:44:01 +00:00
|
|
|
return Palette{Colors: []ui.Color{ColorOlive, ColorDeepSkyBlue, ColorDeepPink, ColorWhite, ColorGrey, ColorGreen, ColorOrange, ColorCian, ColorPurple}}
|
2019-01-31 23:40:05 +00:00
|
|
|
case ThemeLight:
|
2019-03-01 03:44:01 +00:00
|
|
|
return Palette{Colors: []ui.Color{ColorOlive, ColorDeepSkyBlue, ColorDeepPink, ColorWhite, ColorGrey, ColorGreen, ColorOrange, ColorCian, ColorPurple}}
|
2019-01-31 23:40:05 +00:00
|
|
|
default:
|
|
|
|
panic(fmt.Sprintf("Following theme is not supported: %v", theme))
|
|
|
|
}
|
|
|
|
}
|