0.2.0 • Published 8 years ago

color2color v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

color2color

Change one color format to another.
Currently support HSV(HSB) and RGB.

:zap: This is experimental.

Install

npm install color2color

Usage

1. Require into your code.

const rgb2hsv = require('color2color').rgb2hsv;

or

import {rgb2hsv} from 'color2color';

2. convert color

const rgb2hsv = require('color2color').rgb2hsv;

let hsv = rgb2hsv(80, 100, 60);
console.log(hsv); // output hsv array [90, 0.1, 0.3]

TODO

Find more effective way to calculate color format.
Now I just use formula in the reference.

Reference