@daign/color
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

daign-color

NPM package

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

Package Sidebar

Install

npm i @daign/color

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

24.1 kB

Total Files

9

Last publish

Collaborators

  • daign