These are the CSS color names from the CSS spec, as numeric RGB values.
Does not include transparent or currentcolor.
All color names are lowercase. If needed, transform colors using myColor.toLowerCase() before passing.
This library is optimized for parsing using JSON.parse (See https://v8.dev/blog/cost-of-javascript-2019#json).
import { cssColors } from 'css-color-names-rgb';
console.log(cssColors.papayawhip);
// [255, 239, 213]import {
type ColorName,
isCssColorName,
getColor,
} from 'css-color-names-rgb';- color-name doesn't have types included (DT only), and doesn't use
JSON.parseto optimize load time. - css-color-names doesn't have RGB values.
- html-colors doesn't have RGB values.
- css-spec-colors returns RGB values in the form of a CSS
rgb()string. - named-css-colors calculates RGB values from hex, freezes objects, and includes extra utils.