main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
498 bytes
|
Line | |
---|
1 | # node-rgbcolor
|
---|
2 |
|
---|
3 | A nodejs module to parse color values
|
---|
4 | Based on rgbcolor.js by Stoyan Stefanov <sstoo@gmail.com>
|
---|
5 | http://www.phpied.com/rgb-color-parser-in-javascript/
|
---|
6 |
|
---|
7 | ## Usage
|
---|
8 | ```` js
|
---|
9 | var RGBColor = require('rgbcolor');
|
---|
10 |
|
---|
11 | var color = new RGBColor('darkblue');
|
---|
12 |
|
---|
13 | if (color.ok) { // 'ok' is true when the parsing was a success
|
---|
14 | // log channels
|
---|
15 | console.log(color.r + ', ' + color.g + ', ' + color.b);
|
---|
16 | // log HEX and RGB
|
---|
17 | console.log(color.toHex());
|
---|
18 | console.log(color.toRGB());
|
---|
19 | }
|
---|
20 | ````
|
---|
Note:
See
TracBrowser
for help on using the repository browser.