colorparser
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

color-parser

npm Build Status

Parser for CSS color strings.

Usage

const parseColor = require("colorparser");

const red   = parseColor(0xFFFF0000); // = [255, 0, 0, 1.0]
const green = parseColor("rgb(0, 255, 0)"); // [0, 255, 0, 1.0]
const blue  = parseColor("rgba(0, 0, 255, 0.5)"); // [0, 0, 255, 0.5]
const magenta = parseColor("#FF00FF"); // [255, 0, 255, 1.0]

// ...

Readme

Keywords

none

Package Sidebar

Install

npm i colorparser

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • expixel