@olton/colorjs

The small library to manipulate with colors and color schemes

Usage no npm install needed!

<script type="module">
  import oltonColorjs from 'https://cdn.skypack.dev/@olton/colorjs';
</script>

README

Dependencies License: MIT GitHub code size in bytes GitHub release

ColorJS - Manipulate with color

ColorJS is a javascript class designed to work with color. The class implements static and dynamic methods for conveniently working with color, converting it to various formats and generating special color schemes. ColorJs provides simple API that may be used to create colors (HEX, RGB, RGBA, HSV, HSL, HSLA, CMYK) and perform various color related operations (conversions and such) and create any color schemes (complementary, triple, ...)

Contributing

Clone repository / Get source

git clone https://github.com/olton/colorjs

Run tests

yarn test

Install

With npm

npm install @olton/colorjs --save-dev

With yarn

yarn add --dev @olton/colorjs

Using

import Color from "@olton/colorjs";
import {toRGB} from "@olton/colorjs";

const color = new Color("#ffffff");
console.log(color.toRGB()); // RGB {r: 255, g: 255, b: 255}
console.log(color.toRGB().toString()); // rgb(255,255,255)

//Static mode
console.log(toRGB("#ffffff")); // RGB {r: 255, g: 255, b: 255}
console.log(toRGB("#ffffff").toString()); // rgb(255,255,255)

Documentation

You can find the documentation at this link.

License

This software is free to use under the MIT license. See the LICENSE file for license text and copyright information.