Convert with HWB model in Colorblender.
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
.hwb(raw = false)
colorblender({ r: 167, g: 40, b: 13 }).hwb();
colorblender({ r: 167, g: 40, b: 13, a: 0.5 }).hwb();
colorblender({ r: 167, g: 40, b: 13 }).hwb(true);
Manipulation
.whiten(ratio: number)
ratio
is between 0 and 1.
colorblender({ r: 167, g: 40, b: 13 }).whiten(0.2).rgb();
.blacken(ratio: number)
ratio
is between 0 and 1.
colorblender({ r: 167, g: 40, b: 13 }).blacken(0.2).rgb();
Issues
Please file an issue for bugs, missing documentation, or unexpected behavior.
File an issue
License
MIT