Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
The npm package css-color-keywords receives a total of 5,429,736 weekly downloads. As such, css-color-keywords popularity was classified as popular.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.