@strategies/color-utils
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @strategies/color-utils

Weekly Downloads

2

Version

0.0.6

License

MIT

Unpacked Size

25.2 kB

Total Files

5

Last publish

Collaborators

  • ncaler
  • scottdpenman
  • tadiraman
  • sasaki-dev
  • arminakvn
  • eyoungberg
  • sasaki-strategies