Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

color_name_converter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color_name_converter

"converts html color names to a format of your choice"

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

color_name_to_rgb

converts an html color name to a format of your choice

#Installation

	npm install color_name_converter

#Usage

First you require the library:

	var color = require("color_name_to_rgb");

Invoking is easy. You just write:

	var output = color("gold");

The output will be:

	var output = 'rgb(255,215,0)';

As a default the function returns a rgb string. But you can define your format too:

	var output = color("gold", "hex");
	// output = ''#ffd700'';
	
	var output = color("gold", "rgba");
	// output 'rgb(255,215,0,1 )'
	
	var output = color("gold", "array");
	// output [255, 215, 0, 1]
	

Valid formats are rgb, rgba, hex, array, object

Keywords

FAQs

Package last updated on 05 Oct 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc