| 1 |
package palgen |
| 2 |
|
| 3 |
import ( |
| 4 |
"image/color" |
| 5 |
) |
| 6 |
|
| 7 |
// BasicPalette16 is a basic 16-color palette |
| 8 |
var BasicPalette16 = [16][3]byte{ |
| 9 |
{0x0, 0x0, 0x0}, // 0 |
| 10 |
{191, 0x0, 0x0}, // 1 |
| 11 |
{0x0, 191, 0x0}, // 2 |
| 12 |
{191, 191, 0x0}, // 3 |
| 13 |
{0x0, 0x0, 191}, // 4 |
| 14 |
{191, 0x0, 191}, // 5 |
| 15 |
{0x0, 191, 191}, // 6 |
| 16 |
{191, 191, 191}, // 7 |
| 17 |
{0x40, 0x40, 0x40}, // 8 |
| 18 |
{0xff, 0x40, 0x40}, // 9 |
| 19 |
{0x40, 0xff, 0x40}, // 10 |
| 20 |
{0xff, 0xff, 0x40}, // 11 |
| 21 |
{96, 96, 0xff}, // 12 |
| 22 |
{0xff, 0x40, 0xff}, // 13 |
| 23 |
{0x40, 0xff, 0xff}, // 14 |
| 24 |
{0xff, 0xff, 0xff}, // 15 |
| 25 |
} |
| 26 |
|
| 27 |
// BasicPalette can return a basic 16 color palette |
| 28 |
func BasicPalette() (pal color.Palette) { |
| 29 |
for _, rgb := range BasicPalette16 { |
| 30 |
pal = append(pal, color.NRGBA{rgb[0], rgb[1], rgb[2], 255}) |
| 31 |
} |
| 32 |
return pal |
| 33 |
} |