fourdjs/colours.js

10 lines
308 B
JavaScript
Raw Normal View History

import ColorScheme from 'color-scheme';
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);
return scheme.colors().map((cs) => parseInt('0x' + cs));
}