From 78f7a7aadc1ab2519198ab5d62f4d370e470dbf2 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 19 Feb 2020 23:42:26 +0200 Subject: Hardcode name colors so individual colors can be removed --- ui/widget/color.go | 159 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 146 insertions(+), 13 deletions(-) (limited to 'ui') 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. -- cgit v1.2.3