2.0.0 • Published 6 years ago
@olton/colorjs v2.0.0
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/colorjsRun tests
yarn testInstall
With npm
npm install @olton/colorjs --save-devWith yarn
yarn add --dev @olton/colorjsUsing
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.