1.1.0 • Published 11 years ago
hsv2rgb v1.1.0
hsv2rgb
convert from hsv/hsb to rgb
install
npm install hsv2rgb
use
var hsv = require('hsv2rgb');
// using a pre-allocated array
var rgb = [0, 0, 0, 1];
hsv(300, 1, 1.0, rgb)
console.log(rgb) // [ 255, 0, 255, 1]
// or without
console.log(hsv(300, 1, 1.0)) // [ 255, 0, 255 ]api signature
hsv(hue, saturation, value , out)
huewrapping 0-359 degrees (e.g. 390 becomes 30)saturationclamped to 0.0 to 1.0 (percentage)valuclamped 0.0 to 1.0 (percentage)outis an optional 3+ component array (hsv2rgb will only update the first 3 items)