From ecbcde55b2ae63f899f902fa0789a1cd2fb27ed4 Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 26 Nov 2023 14:31:55 +0800 Subject: [PATCH] add some --- base/cli/color.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base/cli/color.go b/base/cli/color.go index b6f3f6bc..72fab819 100644 --- a/base/cli/color.go +++ b/base/cli/color.go @@ -28,11 +28,18 @@ var _color_map = map[string]color.Color{ SILVER: color.RGBA{0xC0, 0xC0, 0xC0, _DARK}, } +var _color_list = map[string]string{ + "aliceblue": "#f0f8ff", + "navy": "#000080", + "firebrick": "#b22222", +} + func _parse_color(str string) color.Color { if str == RANDOM { list := kit.SortedKey(_color_map) str = list[rand.Intn(len(list))] } + str = kit.Select(str, _color_list[str]) if strings.HasPrefix(str, "#") { kit.If(len(str) == 7, func() { str += "ff" }) if u, e := strconv.ParseUint(str[1:], 16, 64); e == nil {