fantasy-console/colors.ts

21 lines
631 B
TypeScript
Raw Normal View History

2023-05-05 11:52:08 -07:00
const colors = {
2023-05-05 14:59:52 -07:00
TRANSPARENT: [0, 0, 0],
2023-05-05 11:52:08 -07:00
BLACK: [0, 0, 0],
WHITE: [1, 1, 1],
RED: [1, 0, 0],
YELLOW: [1, 1, 0],
GREEN: [0, 1, 0],
BLUE: [0, 0, 1],
DARKBLUE: [0.1, 0.05, 0.4],
2023-05-05 14:59:52 -07:00
BROWN: [0.6, 0.5, 0.4],
2023-05-06 10:00:41 -07:00
GRAY: [0.5, 0.5, 0.5],
PURPLE: [0.7, 0.1, 0.85],
ORANGE: [0.95, 0.75, 0.25],
CYAN: [0, 0.9, 0.9],
LIGHTGRAY: [0.75, 0.75, 0.75],
REDDISH: [0.7, 1, 0.5],
2023-05-05 11:52:08 -07:00
} as const;
export const palette: Array<[number, number, number, number]> = Object.values(colors).map(val => [...val, 1]);
export const COLOR = Object.fromEntries(Object.keys(colors).map((name, i) => [name, Number(i)])) as {[key in keyof typeof colors]: number};