颜色

1. 颜色

1.24. 调色板

📚预定义的一组调色板

每个调色板包含若干个前景色、外形线色、背景色。

// Can both use ES6 import and CommonJS require.
//import * as chromotome from 'chromotome';

// Palettes can be acquired randomly...
let palette = chromotome.get(); // chromotome.getRandom() also works.

// ...or by name!
palette = chromotome.get('miradors'); // chromotome.getNames() gets you a list of all the different palette names.

// A palette consists of an array of colors together with (usually) a stroke color and a background color.
console.log(palette.colors); // --> ['#ff6936', '#fddc3f', '#0075ca', '#00bb70']
console.log(palette.stroke); // --> '#ffffff'
console.log(palette.background); // --> '#020202'
https://kgolid.github.io/chromotome-site/