Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@hiimjustin000/colors-css

bwbjustin5MIT1.0.5TypeScript support: included

Get all the colors that are included in CSS.

css, color, colour, colors, colours, css-colors, css-colours, colors-css, colours-css

readme

colors-css

Get all the colors that are included in CSS.

npm npm David David GitHub
NPM

Colors

All CSS colors are properties of an initiated Colors class, which takes the type of color to use. For example:

const Colors = require("@hiimjustin000/colors-css");
const colors = new Colors("hex");
colors.red; // FF0000
Colors.color("DEADED").hex; // DEADED
const Colors = require("@hiimjustin000/colors-css");
const colors = new Colors("rgb");
colors.red; // [255, 0, 0]
Colors.color("DEADED").rgb; // [222, 173, 237]

The list of color types that are included are:

Color Type Format
hex string
rgb [number, number, number]
hsl [number, number, number]
hsv [number, number, number]
hwb [number, number, number]
cmyk [number, number, number, number]
xyz [number, number, number]
lab [number, number, number]
lch [number, number, number]
keyword string
ansi16 number
ansi256 number
hcg [number, number, number]
apple [number, number, number]

CLI

The CLI allows you to view a color and all its different formats.

Format: colors (hex/keyword)

License

This project is licensed under the MIT License.

changelog

1.0.0

  • Added Colors class with constructor! (Constructor takes color type)
  • Added 148 CSS colors to class! (Actually 139 because of aliases)
  • Added static color function to class! (Function takes hex/keyword color)
  • Added CLI that uses the color function! (Basically a port)
  • There is auto-generated documentation and testing, for your convienence.