stepping towards api solidification

This commit is contained in:
2022-03-31 11:22:17 -07:00
parent 12e72a4501
commit b87628ea88
6 changed files with 195 additions and 28 deletions

View File

@@ -1,6 +1,12 @@
package html
var Colors = map[string]int{
import (
"sort"
"github.com/taigrr/go-colorpalettes/simplecolor"
)
var colors = simplecolor.NamedPalette{
"aliceblue": 0xF0F8FF,
"antiquewhite": 0xFAEBD7,
"aqua": 0x00FFFF,
@@ -142,3 +148,11 @@ var Colors = map[string]int{
"yellow": 0xFFFF00,
"yellowgreen": 0x9ACD32,
}
func GetPalette() (sp simplecolor.SimplePalette) {
for _, x := range colors {
sp = append(sp, x)
}
sort.Sort(sp)
return
}