add more getters for named palettes

This commit is contained in:
2024-02-29 09:57:12 -08:00
parent 207c0ad534
commit 42fd438273

View File

@@ -17,6 +17,17 @@ type (
conversionPalette []color.Color conversionPalette []color.Color
) )
func (n NamedPalette) Get(name string) SimpleColor {
return n[name]
}
func (n NamedPalette) Names() (names []string) {
for k := range n {
names = append(names, k)
}
return
}
func (n NamedPalette) ToSimplePalette() SimplePalette { func (n NamedPalette) ToSimplePalette() SimplePalette {
var sp SimplePalette var sp SimplePalette
for _, c := range n { for _, c := range n {