mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
add some
This commit is contained in:
parent
fca822c569
commit
ecbcde55b2
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user