1. rgb
converts all sorts of colors to rgb format.
rgb
Package: rgb
Created by: kamicane
Last modified: Sun, 26 Jun 2022 13:07:04 GMT
Version: 0.1.0
License: MIT (http://mootools.net/license.txt)
Downloads: 1,031,753
Repository: https://github.com/kamicane/rgb

Install

npm install rgb
yarn add rgb

rgb

converts all sorts of colors to rgb format

basic usage

 var color = require("rgb")

color("hsl(50, 50, 50)") //'rgb(191,170,64)'
color("#000") //'rgb(0,0,0)'
color("hsl(50, 50, 50, 0.5)") //'rgba(191,170,64,0.5)'
color("maroon") //'rgb(128,0,0)'
color("#ff330033") //'rgba(255,51,0,0.2)'

matches

 var color = require("rgb")

color.matches("#ff330033") //true

replace

 var color = require("rgb")

color.replace("the color is #ff330033") //'the color is rgba(255,51,0,0.2)'

color.replace("the color is #ff330033", function(match){
    return color(match)
}) //'the color is rgba(255,51,0,0.2)'

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