1. rgbcolor
A module to parse color values
rgbcolor
Package: rgbcolor
Created by: yetzt
Last modified: Sun, 26 Jun 2022 13:07:41 GMT
Version: 1.0.1
License: MIT OR SEE LICENSE IN FEEL-FREE.md
Downloads: 5,288,181
Repository: https://github.com/yetzt/node-rgbcolor

Install

npm install rgbcolor
yarn add rgbcolor

node-rgbcolor

A nodejs module to parse color values
Based on rgbcolor.js by Stoyan Stefanov [email protected]
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());
}

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code