parseColor parses a color string (ANSI name, W3C name, or hex code) to tcell.Color.
(s string)
| 623 | |
| 624 | // parseColor parses a color string (ANSI name, W3C name, or hex code) to tcell.Color. |
| 625 | func parseColor(s string) tcell.Color { |
| 626 | if strings.EqualFold(s, "default") { |
| 627 | return tcell.ColorDefault |
| 628 | } |
| 629 | |
| 630 | return tcell.GetColor(s) |
| 631 | } |