Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/katsew/color2color
https://github.com/katsew/color2color
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/katsew/color2color
- Owner: katsew
- Created: 2016-03-15T15:03:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-15T15:25:30.000Z (almost 9 years ago)
- Last Synced: 2025-01-14T01:47:13.199Z (29 days ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
- [HSV色空間](https://ja.wikipedia.org/wiki/HSV%E8%89%B2%E7%A9%BA%E9%96%93)
- [数学記号の表](https://ja.wikipedia.org/wiki/%E6%95%B0%E5%AD%A6%E8%A8%98%E5%8F%B7%E3%81%AE%E8%A1%A8)