Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/erikyo/color-esm


https://github.com/erikyo/color-esm

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

Chainable color module using modern js

// Example usage:
const color1 = Color.fromString('rgbString(255, 255, 255)');
const color2 = Color.fromObject({ r: 255, g: 255, b: 255 });
const color3 = Color.rgbString(255, 255, 255);
const color4 = Color.rgbArray([255, 255, 255]);

console.log(color1); // Outputs: Color { color: { r: 255, g: 255, b: 255, a: 1 } }
console.log(color2); // Outputs: Color { color: { r: 255, g: 255, b: 255, a: 1 } }
console.log(color3); // Outputs: Color { color: { r: 255, g: 255, b: 255, a: 1 } }
console.log(color4); // Outputs: Color { color: { r: 255, g: 255, b: 255, a: 1 } }