@sadbox/color

1.0.0 • Public • Published

Version License Dependencies Bundle Size Build Status Codecov

Color

A lightweight browser compatible color parser.

Installation

npm install @sadbox/color

yarn add @sadbox/color

Supported formats

  • #xxx
  • #xxxx
  • #xxxxxx
  • #xxxxxxxx
  • rgb()
  • rgba()
  • hsl()
  • hsla()

How to use

import { Color } from '@sadbox/color';

const color = new Color('#ffff');

color.rgb; // [255, 255, 255]
color.hsl; // [0, 0, 100]
color.alpha; // 1

color.rgb = [0, 0, 0];
color.hsl; // [0, 0, 0]

console.log(color); // #000000

Readme

Keywords

none

Package Sidebar

Install

npm i @sadbox/color

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

34.4 kB

Total Files

9

Last publish

Collaborators

  • strayiker