2023-08-02 06:58:51 +00:00
|
|
|
import ColorScheme from 'color-scheme';
|
|
|
|
|
2023-08-04 03:49:39 +00:00
|
|
|
export const get_colours = (basis) => {
|
|
|
|
const scheme = new ColorScheme;
|
|
|
|
const hexbasis = basis.toString(16).padStart(6, "0");
|
2023-08-06 08:54:32 +00:00
|
|
|
scheme.from_hex(hexbasis).scheme("tetrade").variation("hard").distance(0.5);
|
2023-09-10 08:26:15 +00:00
|
|
|
const colours = scheme.colors().map((cs) => parseInt('0x' + cs));
|
|
|
|
const set = colours.slice(1, 6);
|
|
|
|
set.reverse();
|
|
|
|
set.unshift(colours[0]);
|
|
|
|
return set;
|
2023-08-02 06:58:51 +00:00
|
|
|
}
|
|
|
|
|
2023-09-10 08:26:15 +00:00
|
|
|
// basic colours where 0 = blue
|
|
|
|
// 1 - dark blue
|
|
|
|
// 2 - white
|
|
|
|
// 3 - light cyan
|
|
|
|
// 4 - light orange
|
|
|
|
// 5 - dark orange
|
|
|
|
|
2023-08-27 22:31:45 +00:00
|
|
|
export const get_plain_colours = (basis) => {
|
|
|
|
return [
|
|
|
|
basis,
|
|
|
|
0xffffff,
|
|
|
|
0x00ff00,
|
|
|
|
0xff0000,
|
|
|
|
0x0000ff,
|
|
|
|
0xff9900,
|
|
|
|
0x000000,
|
|
|
|
]
|
|
|
|
}
|