2017-03-08 10:40:03 +11:00
|
|
|
package main
|
|
|
|
|
|
2017-03-15 10:02:46 +10:00
|
|
|
import (
|
2026-09-14 14:06:49 +03:30
|
|
|
"github.com/bcicen/ctop/theme"
|
2017-03-15 10:02:46 +10:00
|
|
|
|
|
|
|
|
ui "github.com/gizak/termui"
|
|
|
|
|
)
|
2017-03-08 10:40:03 +11:00
|
|
|
|
2026-09-14 14:06:49 +03:30
|
|
|
var ColorMap map[string]ui.Attribute
|
2017-03-08 10:40:03 +11:00
|
|
|
|
2026-09-14 14:06:49 +03:30
|
|
|
// SetColorMap installs the color scheme for the currently selected theme
|
|
|
|
|
func SetColorMap() {
|
|
|
|
|
ColorMap = theme.BuildColorMap()
|
2017-03-08 10:40:03 +11:00
|
|
|
}
|
2017-03-15 10:02:46 +10:00
|
|
|
|
2026-09-14 14:06:49 +03:30
|
|
|
// InvertColorMap switches to the inverse (light/dark) flavor
|
2017-03-15 10:02:46 +10:00
|
|
|
func InvertColorMap() {
|
2026-09-14 14:06:49 +03:30
|
|
|
if theme.Current() == theme.Latte {
|
|
|
|
|
theme.Set(theme.Mocha)
|
|
|
|
|
} else {
|
|
|
|
|
theme.Set(theme.Latte)
|
2017-03-15 10:02:46 +10:00
|
|
|
}
|
2026-09-14 14:06:49 +03:30
|
|
|
SetColorMap()
|
|
|
|
|
}
|