Skip to content
thednp edited this page Mar 28, 2022 · 3 revisions

Everything is developed with "tree shaking" in mind, you can make use of everything ColorPicker has to offer, however here are your main classes:

Initialize a certain input:

import ColorPicker from '@thednp/color-picker';

const myPicker = new ColorPicker('#myPicker');

Make use of the built in Color class:

import Color from '@thednp/color-picker/src/js/color';

const myColor = new Color('#069', { format: 'hsl' });

// do some stuff
const myHSLColor = new Color(myColor.toHsl());

// export to HSL string
myHSLColor.toHslString();

Create a custom colour palette:

import ColorPalette from '@thednp/color-picker/src/color-palette';

const myPalette = new ColorPalette (24, 10);

You can find a more in-depth guide in the API section.

Clone this wiki locally