aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/widget/color.go159
1 files changed, 146 insertions, 13 deletions
diff --git a/ui/widget/color.go b/ui/widget/color.go
index a121731..edb966c 100644
--- a/ui/widget/color.go
+++ b/ui/widget/color.go
@@ -19,23 +19,156 @@ package widget
import (
"fmt"
"hash/fnv"
- "sort"
"maunium.net/go/tcell"
)
-var colorNames []string
-
-// init initializes the colorNames array.
-func init() {
- colorNames = make([]string, len(tcell.ColorNames))
- i := 0
- for name := range tcell.ColorNames {
- colorNames[i] = name
- i++
- }
- // In order to have consistent coloring between restarts, we need to sort the array.
- sort.Sort(sort.StringSlice(colorNames))
+var colorNames = []string{
+ "maroon",
+ "green",
+ "olive",
+ "navy",
+ "purple",
+ "teal",
+ "silver",
+ "gray",
+ "red",
+ "lime",
+ "yellow",
+ "blue",
+ "fuchsia",
+ "aqua",
+ "white",
+ "aliceblue",
+ "antiquewhite",
+ "aquamarine",
+ "azure",
+ "beige",
+ "bisque",
+ "blanchedalmond",
+ "blueviolet",
+ "brown",
+ "burlywood",
+ "cadetblue",
+ "chartreuse",
+ "chocolate",
+ "coral",
+ "cornflowerblue",
+ "cornsilk",
+ "crimson",
+ "darkblue",
+ "darkcyan",
+ "darkgoldenrod",
+ "darkgray",
+ "darkgreen",
+ "darkkhaki",
+ "darkmagenta",
+ "darkolivegreen",
+ "darkorange",
+ "darkorchid",
+ "darkred",
+ "darksalmon",
+ "darkseagreen",
+ "darkslateblue",
+ "darkslategray",
+ "darkturquoise",
+ "darkviolet",
+ "deeppink",
+ "deepskyblue",
+ "dimgray",
+ "dodgerblue",
+ "firebrick",
+ "floralwhite",
+ "forestgreen",
+ "gainsboro",
+ "ghostwhite",
+ "gold",
+ "goldenrod",
+ "greenyellow",
+ "honeydew",
+ "hotpink",
+ "indianred",
+ "indigo",
+ "ivory",
+ "khaki",
+ "lavender",
+ "lavenderblush",
+ "lawngreen",
+ "lemonchiffon",
+ "lightblue",
+ "lightcoral",
+ "lightcyan",
+ "lightgoldenrodyellow",
+ "lightgray",
+ "lightgreen",
+ "lightpink",
+ "lightsalmon",
+ "lightseagreen",
+ "lightskyblue",
+ "lightslategray",
+ "lightsteelblue",
+ "lightyellow",
+ "limegreen",
+ "linen",
+ "mediumaquamarine",
+ "mediumblue",
+ "mediumorchid",
+ "mediumpurple",
+ "mediumseagreen",
+ "mediumslateblue",
+ "mediumspringgreen",
+ "mediumturquoise",
+ "mediumvioletred",
+ "midnightblue",
+ "mintcream",
+ "mistyrose",
+ "moccasin",
+ "navajowhite",
+ "oldlace",
+ "olivedrab",
+ "orange",
+ "orangered",
+ "orchid",
+ "palegoldenrod",
+ "palegreen",
+ "paleturquoise",
+ "palevioletred",
+ "papayawhip",
+ "peachpuff",
+ "peru",
+ "pink",
+ "plum",
+ "powderblue",
+ "rebeccapurple",
+ "rosybrown",
+ "royalblue",
+ "saddlebrown",
+ "salmon",
+ "sandybrown",
+ "seagreen",
+ "seashell",
+ "sienna",
+ "skyblue",
+ "slateblue",
+ "slategray",
+ "snow",
+ "springgreen",
+ "steelblue",
+ "tan",
+ "thistle",
+ "tomato",
+ "turquoise",
+ "violet",
+ "wheat",
+ "whitesmoke",
+ "yellowgreen",
+ "grey",
+ "dimgrey",
+ "darkgrey",
+ "darkslategrey",
+ "lightgrey",
+ "lightslategrey",
+ "slategrey",
}
// GetHashColorName gets a color name for the given string based on its FNV-1 hash.