@peculiar/color

Library for color manipulation and conversion in JavaScript.

Usage no npm install needed!

<script type="module">
  import peculiarColor from 'https://cdn.skypack.dev/@peculiar/color';
</script>

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() // => Color[];

📝 License

Licensed under the MIT.