2
1
Fork 0

Adds mode for removing colors

This commit is contained in:
sloum 2021-03-26 09:15:07 -07:00
parent 1a235c3ecd
commit 67eae4866c
2 changed files with 13 additions and 2 deletions

View File

@ -9,6 +9,7 @@ const (
SimpleColor int = iota
EightBitColor
TrueColor
Term // more or less no color added
)
type Styles struct {
@ -49,11 +50,19 @@ var colors = map[int]map[string]string{
"LaneSelected": "\033[38;2;25;25;25m\033[48;2;255;184;16m",
"Input": "\033[38;2;25;25;25m\033[48;2;253;244;220m",
},
Term: map[string]string{
"Header": "",
"Message": "",
"MessageErr": "",
"Lane": "",
"LaneSelected": "",
"Input": "",
},
}
func (s *Styles) SetColorMode(kind int) {
switch kind {
case SimpleColor, EightBitColor, TrueColor:
case SimpleColor, EightBitColor, TrueColor, Term:
s.Mode = kind
default:
ct := os.Getenv("COLORTERM")

View File

@ -216,13 +216,15 @@ func SetColorFromFlag(f string) int {
return EightBitColor
case "TRUE":
return TrueColor
case "NONE", "OFF":
return Term
default:
return -1
}
}
func main() {
colors := flag.String("color", "", "Color mode: 8, 256, or TRUE" )
colors := flag.String("color", "", "Color mode: 8, 256, True, None" )
flag.Parse()
args := flag.Args()
style.Init(SetColorFromFlag(*colors))