Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/node-rgb2ryb
Convert colors in JavaScript from rgb to ryb and back
https://github.com/bahamas10/node-rgb2ryb
Last synced: 2 months ago
JSON representation
Convert colors in JavaScript from rgb to ryb and back
- Host: GitHub
- URL: https://github.com/bahamas10/node-rgb2ryb
- Owner: bahamas10
- Created: 2012-09-28T07:48:27.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-02T01:02:04.000Z (almost 12 years ago)
- Last Synced: 2024-05-08T20:00:59.057Z (8 months ago)
- Language: JavaScript
- Size: 116 KB
- Stars: 9
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
rgb2ryb
=======Convert colors in JavaScript from rgb to ryb and back
## *DEPRECATION NOTICE*
The calculations presented here are not accurate, this module has been deprecated
in favor of [ryb2rgb](https://github.com/bahamas10/node-ryb2rgb) (`npm install ryb2rgb`)Example
-------### rgb2ryb
``` js
var rgb2ryb = require('../rgb2ryb'),
console.log(rgb2ryb([0, 255, 0]));
```yields
``` json
[0, 255, 255]
```### ryb2rgb
``` js
var rgb2ryb = require('../rgb2ryb'),
console.log(rgb2ryb.ryb2rgb([0, 255, 0]));
```yields
``` json
[255, 255, 0]
```### complimentary
``` js
var rgb2ryb = require('../rgb2ryb'),
console.log(rgb2ryb.complimentary([0, 255, 0]));
```yields
``` json
[255, 0, 255]
```Functions
---------These functions are available in Node and in the browser
- `color`: an array of rgb/ryb values. ie `[0, 255, 255]`
### rgb2ryb(color)
Convert from rgb to ryb
### ryb2rgb(color)
Convert from ryb to rgb
### complimentary(color, [limit])
Easily calculate a colors complimentary, limit defaults to 255
Usage
-----``` js
var rgb2ryb = require('rgb2ryb');
```or
``` html
```
Installation
------------npm install rgb2ryb
Credits
-------Original code http://www.insanit.net/computer-programming/red-green-blue-to-red-yellow-blue-part-2/
Ported to JS for node and the browser
License
-------MIT