Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
color-name
Advanced tools
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.
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
The color-convert package provides functions for converting between different color formats (e.g., RGB, HSL, HEX, etc.). It offers more comprehensive functionality for color conversions compared to color-name, which only maps color names to RGB values.
Tinycolor2 is a small, fast library for color manipulation and conversion in JavaScript. It provides many utilities for working with colors, such as color parsing, manipulation, and conversion. It is more feature-rich than color-name, which is focused solely on mapping color names to their hex codes.
Chroma.js is a small-ish zero-dependency JavaScript library for all kinds of color conversions and color scales. It is more advanced than color-name, offering features like color scale generation, color blending, and manipulation.
A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
import colors from 'color-name';
colors.red //[255,0,0]
FAQs
A list of color names and its values
We found that color-name demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.