-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbasic16.go
More file actions
33 lines (30 loc) · 759 Bytes
/
basic16.go
File metadata and controls
33 lines (30 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package palgen
import (
"image/color"
)
// BasicPalette16 is a basic 16-color palette
var BasicPalette16 = [16][3]byte{
{0x0, 0x0, 0x0}, // 0
{191, 0x0, 0x0}, // 1
{0x0, 191, 0x0}, // 2
{191, 191, 0x0}, // 3
{0x0, 0x0, 191}, // 4
{191, 0x0, 191}, // 5
{0x0, 191, 191}, // 6
{191, 191, 191}, // 7
{0x40, 0x40, 0x40}, // 8
{0xff, 0x40, 0x40}, // 9
{0x40, 0xff, 0x40}, // 10
{0xff, 0xff, 0x40}, // 11
{96, 96, 0xff}, // 12
{0xff, 0x40, 0xff}, // 13
{0x40, 0xff, 0xff}, // 14
{0xff, 0xff, 0xff}, // 15
}
// BasicPalette can return a basic 16 color palette
func BasicPalette() (pal color.Palette) {
for _, rgb := range BasicPalette16 {
pal = append(pal, color.NRGBA{rgb[0], rgb[1], rgb[2], 255})
}
return pal
}