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

color-name

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-name

A list of color names and its values

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is color-name?

The color-name npm package provides a list of color names and their corresponding hexadecimal color codes. It is a simple mapping of color names to their hex values, which can be useful for various applications where color names need to be converted to hex codes and vice versa.

What are color-name's main functionalities?

Get Hex Code by Color Name

This feature allows you to retrieve the RGB values of a color by providing its name as a key. The output is an array of RGB values.

"use strict";
const colorName = require('color-name');
console.log(colorName['red']); // Outputs: [255, 0, 0]

Check if Color Name Exists

This feature allows you to check if a color name exists within the package's mapping by checking if the key is defined.

"use strict";
const colorName = require('color-name');
console.log(colorName['rebeccapurple'] !== undefined); // Outputs: true

Other packages similar to color-name

Keywords

FAQs

Package last updated on 08 Nov 2022

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