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

1.0.6 • Public • Published

Super Color

Small & Fast Color conversion library.

Installation

npm i super-color

Examples

import SuperColor from "super-color";

const superColor = new SuperColor("#f00");
console.log(superColor.toString()); // #f00

superColor.setFormat("hsl");
console.log(superColor.toString()); // hsl(0deg, 100%, 50%)

superColor.setFormat("rgb");
console.log(superColor.toString()); // rgb(255, 0, 0)

superColor.setAlpha(0.5);
console.log(superColor.toString()); // rgba(255, 0, 0, 0.5)

superColor.setHsv({ h: 100, v: 0.8 });
console.log(superColor.toString()); // rgba(67, 204, 0, 0.5)

superColor.setFormat("hex");
console.log(superColor.toString()); // #43CC0080

License

GPL licensed.

Package Sidebar

Install

npm i super-color

Weekly Downloads

19

Version

1.0.6

License

GPL-3.0-or-later

Unpacked Size

71.9 kB

Total Files

27

Last publish

Collaborators

  • arnaudpfu