Color Utilities
Currently only a single ColorProvider
class is provided here, but we may add additional utilities for working with color - particularly related to data visualization.
Install
pnpm install @strategies/color-utils
Example
Use with default palettes:
import {ColorProvider} from '@strategies/color-utils';
const colorProvider = new ColorProvider();
const newColor = colorProvider.next();
OR
const newColor = colorProvider.random();
Specify custom palettes:
import {colorbrewerPalettes, ColorProvider} from '@strategies/color-utils';
const palette1 = colorbrewerPalettes.Pastel1['9'];
const palette2 = colorbrewerPalettes.Accent['8'];
const colorProvider = new ColorProvider([palette1, palette2]);
const newColor = colorProvider.next();
Publish
There is no build step - only TS environments are supported.
Commit to Git, then:
pnpm publish