1.0.3 • Published 2 months ago
@colorblender/hwb v1.0.3
Installation
This package require colorblender
to work.
npm install @colorblender/hwb
Import
import { colorblender, extend } from 'colorblender';
import { hwbExtension } from '@colorblender/hwb';
extend([hwbExtension]);
Usage
Create colorblender instance
colorblender({ h: 0, w: 0, b: 0 });
colorblender({ h: 0, w: 0, b: 0, a: 1 });
Methods
Conversion
colorblender({ r: 167, g: 40, b: 13 }).hwb(); // { h: 11, w: 5, b: 35, a: 1 }
colorblender({ r: 167, g: 40, b: 13, a: 0.5 }).hwb(); // { h: 11, w: 5, b: 35, a: 0.5 }
colorblender({ r: 167, g: 40, b: 13 }).hwb(true); // { h: 10.51948051948052, w: 5.098039215686274, b: 34.509803921568626, , a: 1 }
Manipulation
ratio
is between 0 and 1.
colorblender({ r: 167, g: 40, b: 13 }).whiten(0.2).rgb(); // { r: 167, b: 16, g: 42 }
ratio
is between 0 and 1.
colorblender({ r: 167, g: 40, b: 13 }).blacken(0.2).rgb(); // { r: 149, b: 13, g: 37 }
Issues
Please file an issue for bugs, missing documentation, or unexpected behavior.
License
MIT