Sudoo-Color

Continuous Integration codecov npm version downloads

:deciduous_tree: Color Controller

Install

yarn add @sudoo/color
# Or
npm install @sudoo/color --save

Usage

To initialize color instance.

import { Color } from "@sudoo/color";

const blackColor: Color = Color.black();
const hexColor: Color = Color.fromHEX('#AAAAAA'); // Pound is optional
const rgbColor: Color = Color.fromRGB(50, 50, 50);
const rgbaColor: Color = Color.fromRGBA(50, 50, 50, 15);

To mutate color.

const newColor: Color = rgbColor.dyeGreen(15); // (50, 65, 60)
const newColor: Color = rgbColor.highlightGreen(0.5); // (40, 75, 40)
const newColor: Color = rgbColor.highlightGreen(0.5, 0); // (50, 75, 50)

To export color.

newColor.toHEX();

Theres a lot more advanced usage. Checkout source code!