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

css-color-names

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-color-names

A JSON Object of css color names mapped to their hex value

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.3M
increased by2.26%
Maintainers
1
Weekly downloads
 
Created

What is css-color-names?

The css-color-names npm package provides a JSON object where the keys are CSS color names and the values are their corresponding hexadecimal color codes. It is a simple utility that can be used to convert CSS color names to hex codes and vice versa, facilitating developers in handling color names within their projects.

What are css-color-names's main functionalities?

Convert CSS color name to hex code

This feature allows you to retrieve the hexadecimal code of a CSS color name by accessing the value associated with the color name key in the css-color-names object.

"const cssColorNames = require('css-color-names');
console.log(cssColorNames['tomato']); // Outputs: '#ff6347'"

Check if a color name is valid

This demonstrates how to check if a given string is a valid CSS color name by checking if it is a key in the css-color-names object.

"const cssColorNames = require('css-color-names');
console.log('rebeccapurple' in cssColorNames); // Outputs: true"

Other packages similar to css-color-names

Keywords

FAQs

Package last updated on 08 Oct 2018

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