chatty-pub/node_modules/rgbcolor
كارل مبارك 374620645c initial commit
2021-06-26 13:12:56 +02:00
..
FEEL-FREE.md initial commit 2021-06-26 13:12:56 +02:00
index.js initial commit 2021-06-26 13:12:56 +02:00
LICENSE.md initial commit 2021-06-26 13:12:56 +02:00
package.json initial commit 2021-06-26 13:12:56 +02:00
README.md initial commit 2021-06-26 13:12:56 +02:00

node-rgbcolor

A nodejs module to parse color values Based on rgbcolor.js by Stoyan Stefanov sstoo@gmail.com http://www.phpied.com/rgb-color-parser-in-javascript/

Usage

var RGBColor = require('rgbcolor');

var color = new RGBColor('darkblue');

if (color.ok) { // 'ok' is true when the parsing was a success
    // log channels
    console.log(color.r + ', ' + color.g + ', ' + color.b);
    // log HEX and RGB
    console.log(color.toHex());
    console.log(color.toRGB());
}