Determine the Soldiers At War palette
This commit also takes the first step towards making it configurable; override `internal/palettes.DefaultPaletteName` at build time to choose one palette over another. It would be nice to set this at runtime!
This commit is contained in:
21
internal/palettes/palettes.go
Normal file
21
internal/palettes/palettes.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package palettes
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// Override this to change the palette globally
|
||||
const DefaultPaletteName = "ChaosGate"
|
||||
|
||||
var (
|
||||
Transparent = color.RGBA{R: 0, G: 0, B: 0, A: 0}
|
||||
|
||||
Palettes = map[string]color.Palette{}
|
||||
|
||||
initPalettes = sync.Once{}
|
||||
)
|
||||
|
||||
func DefaultPalette() color.Palette {
|
||||
return Palettes[DefaultPaletteName]
|
||||
}
|
Reference in New Issue
Block a user