0.1.1 • Published 3 years ago
@imretro/color v0.1.1
@imretro/color
Color util library
This library provides some simple utilities for representing colors.
Example
import { Grayscale, RGBA } from '@imretro/color';
const black = new Grayscale(0);
console.log(black.r, black.g, black.b, black.a); // 0 0 0 255
const transparentGreen = new RGBA(0, 255, 0, 127);
console.log(transparentGreen.hex); // #00FF00
console.log(`${Math.round(transparentGreen.opacity * 100)}%`); // 50%
0.1.1
3 years ago