1.0.2 • Published 5 years ago
@daign/color v1.0.2
daign-color
Simple color utils library in Typescript
Every class implements an observable pattern.
Installation
npm install @daign/color --saveUsage
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 buildRun lint analysis
npm run lintRun unit tests with code coverage
npm run test