Socket
Socket
Sign inDemoInstall

rgb

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rgb

converts all sorts of colors to rgb format.


Version published
Weekly downloads
181K
decreased by-15.7%
Maintainers
1
Install size
5.79 kB
Created
Weekly downloads
 

Readme

Source

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)'

Keywords

FAQs

Last updated on 01 May 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc