@hiimjustin000/colors-css

Get all the colors that are included in CSS.

Usage no npm install needed!

<script type="module">
  import hiimjustin000ColorsCss from 'https://cdn.skypack.dev/@hiimjustin000/colors-css';
</script>

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.