45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
"""Mattel Intellivision STIC 16-colour palette (MAME `intv` values).
|
|
|
|
Verified against MAME pixel reads (white=7 #FFFCFF, brown/olive=11 #546E00,
|
|
magenta=15 #B51A58). In Color-Stack mode the per-card FOREGROUND is limited to
|
|
the first 8 colours (3 bits); the BACKGROUND (colour-stack entry) may be any of
|
|
the 16.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import numpy as np
|
|
|
|
from ..palette import srgb_to_lab
|
|
|
|
STIC = np.array([
|
|
(0x00, 0x00, 0x00), # 0 black
|
|
(0x00, 0x2D, 0xFF), # 1 blue
|
|
(0xFF, 0x3D, 0x10), # 2 red
|
|
(0xC9, 0xCF, 0xAB), # 3 tan
|
|
(0x38, 0x6B, 0x3F), # 4 dark green
|
|
(0x00, 0xA7, 0x56), # 5 green
|
|
(0xFA, 0xEA, 0x50), # 6 yellow
|
|
(0xFF, 0xFC, 0xFF), # 7 white
|
|
(0xBD, 0xAC, 0xC8), # 8 grey
|
|
(0x24, 0xB8, 0xFF), # 9 cyan
|
|
(0xFF, 0xB4, 0x1F), # 10 orange
|
|
(0x54, 0x6E, 0x00), # 11 brown / olive
|
|
(0xFF, 0x4E, 0x57), # 12 pink
|
|
(0xA4, 0x96, 0xFF), # 13 light blue
|
|
(0x75, 0xCC, 0x80), # 14 yellow-green
|
|
(0xB5, 0x1A, 0x58), # 15 magenta
|
|
], dtype=np.float64)
|
|
|
|
# Foreground colours usable per card in Color-Stack mode (3-bit field).
|
|
FG_USABLE = list(range(8))
|
|
# Background (colour-stack) may be any of the 16.
|
|
BG_USABLE = list(range(16))
|
|
|
|
|
|
def get_palette() -> np.ndarray:
|
|
return STIC
|
|
|
|
|
|
def palette_lab() -> np.ndarray:
|
|
return srgb_to_lab(STIC)
|