Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
css-color-keywords
Advanced tools
The css-color-keywords package provides a list of CSS color keywords as specified in CSS Color Module Level 4. It allows developers to access a comprehensive list of predefined color names that can be used in CSS files, making it easier to apply color styles without needing to remember specific color codes.
Accessing CSS Color Keywords
This feature allows you to access the hexadecimal color code for CSS color keywords. The example demonstrates how to retrieve the color code for 'red'.
const colors = require('css-color-keywords');
console.log(colors.red); // Outputs the color code for 'red'
Iterating Over All Color Keywords
This feature enables iterating over all available CSS color keywords and their corresponding color codes. The code sample iterates through the color keywords and prints each color name along with its hexadecimal code.
const colors = require('css-color-keywords');
for (const color in colors) {
console.log(`${color}: ${colors[color]}`);
}
The color-name package offers a list of color names and their RGB values. It is similar to css-color-keywords but provides RGB values instead of hexadecimal codes, making it more suitable for applications that require RGB format.
colornames provides a mapping between color names and their hexadecimal codes, similar to css-color-keywords. However, it also includes additional functionality for converting color names to RGB values and vice versa, offering more versatility.
A list of all CSS color keywords.
This list contains all CSS color keywords specified in:
See MDN for an overview of all colors.
$ npm install css-color-keywords --save
const cssColorKeywords = require('css-color-keywords')
cssColorKeywords.black // #000000
cssColorKeywords.orange // #ffa500
Returns an object where each key is a keyword (e.g. black
) and the value is
the keyword’s RGB hex value (e.g. #000000
).
Even though CSS color keywords are case-insensitive, this list only contains lowercase keywords (and returns lowercase RGB hex values).
This project follows Semantic Versioning 2.
This list aims to always include all CSS color keywords. If new keywords are specified, only the minor version will be bumped.
css-color-keywords
is licensed under the ISC license.
See LICENSE
for the full license.
FAQs
A list of all CSS color keywords.
We found that css-color-keywords demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.