1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export let unzipColor = (input: number): [
number,
number,
number,
] => {
const size = 6;
const step = 255 / 5;
const b = input % size;
const g = Math.floor((input / size) % size);
const r = Math.floor(input / size / size);
return [
Math.round(r * step),
Math.round(g * step),
Math.round(b * step),
];
};