Source the palette name from data

This commit is contained in:
2020-06-01 01:24:44 +01:00
parent c1268e8d57
commit 3866ee07a8
8 changed files with 35 additions and 22 deletions

View File

@@ -5,9 +5,6 @@ import (
"sync"
)
// Override this to change the palette globally
const DefaultPaletteName = "ChaosGate"
var (
Transparent = color.RGBA{R: 0, G: 0, B: 0, A: 0}
@@ -16,6 +13,8 @@ var (
initPalettes = sync.Once{}
)
func DefaultPalette() color.Palette {
return Palettes[DefaultPaletteName]
func Get(name string) (color.Palette, bool) {
p, ok := Palettes[name]
return p, ok
}