color-space
Advanced tools
Comparing version 1.14.5 to 1.14.6
{ | ||
"name": "color-space", | ||
"description": "Color space conversions and data", | ||
"version": "1.14.5", | ||
"version": "1.14.6", | ||
"author": "Deema Yvanow <dfcreative@gmail.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -104,7 +104,12 @@ # Color-space [![Build Status](https://travis-ci.org/scijs/color-space.svg?branch=master)](https://travis-ci.org/scijs/color-space) [![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges) | ||
## Credits | ||
Thanks to all the color scientists, who devoted their lives to color research and delivered their knowledge to us, for now we can trust them and use their formulas and their code. | ||
## Related | ||
* [colormap](https://github.com/bpostlethwaite/colormap) — collection of colormaps to map colors of images/data. A replacement for visualising spaces like cubehelix. | ||
* [color-measure](https://www.npmjs.com/package/color-measure) — list of color measurement functions. | ||
* [color-manipulate](https://www.npmjs.com/package/color-manipulate) — list of color manipulation functions. | ||
* [color-spectrum](https://www.npmjs.com/package/color-spectrum) — convert spectrum to a color. | ||
* [color-interpolate](https://www.npmjs.com/package/color-interpolate) — interpolate between color values. | ||
* [color-tool](https://www.npmjs.com/package/color-tool) — color picker based on color-space. | ||
@@ -111,0 +116,0 @@ |
17
xyz.js
@@ -82,6 +82,9 @@ /** | ||
*/ | ||
xyz.rgb = function (xyz) { | ||
var x = xyz[0] / 100, | ||
y = xyz[1] / 100, | ||
z = xyz[2] / 100, | ||
xyz.rgb = function (_xyz, white) { | ||
//FIXME: make sure we have to divide like this. Probably we have to replace matrix as well then | ||
white = white || xyz.whitepoint[2].E; | ||
var x = _xyz[0] / white[0], | ||
y = _xyz[1] / white[1], | ||
z = _xyz[2] / white[2], | ||
r, g, b; | ||
@@ -120,3 +123,3 @@ | ||
*/ | ||
rgb.xyz = function(rgb) { | ||
rgb.xyz = function(rgb, white) { | ||
var r = rgb[0] / 255, | ||
@@ -135,3 +138,5 @@ g = rgb[1] / 255, | ||
return [x * 100, y *100, z * 100]; | ||
white = white || xyz.whitepoint[2].E; | ||
return [x * white[0], y * white[1], z * white[2]]; | ||
}; | ||
@@ -138,0 +143,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67690
2287
124