@peculiar/color
v0.1.4
Published
Library for color manipulation and conversion in JavaScript.
Downloads
2,568
Readme
@peculiar/color
Library for color manipulation and conversion in JavaScript.
Getting started
To install @peculiar/color
in your project, you will need to run the
following command using npm:
npm install @peculiar/color
If you prefer Yarn, use the following command instead:
yarn add @peculiar/color
Usage
import { Color } from '@peculiar/color';
const color = new Color('#5EBC54');
color.toHex() // => '5EBC54';
color.toHsb() // => [114, 55, 74];
color.toRgb() // => [94, 188, 84];
palette
The palette generator can be used to generate a palette for any color you input.
import { Color } from '@peculiar/color';
const color = new Color('#5EBC54');
color.palette() // => Record<PaletteTypes, Color>;
📝 License
Licensed under the MIT.