@daign/color
v1.0.2
Published
Simple color utils library in Typescript
Downloads
3
Readme
daign-color
Simple color utils library in Typescript
Every class implements an observable pattern.
Installation
npm install @daign/color --save
Usage
import {Color} from '@daign/color';
import {Gradient} from '@daign/color';
// Create color objects
const color1 = new Color( 255, 255, 255, 1 );
const color2 = new Color().setFromHex( '#ff9933' );
// Create gradient object
const gradient = new Gradient();
gradient.addColorStop( 0, color1 );
gradient.addColorStop( 1, color2 );
// Get interpolated color from the gradient
console.log( gradient.colorAt( 0.5 ).hex );
Scripts
Build
npm run build
Run lint analysis
npm run lint
Run unit tests with code coverage
npm run test