color-space
Advanced tools
Comparing version 1.14.6 to 1.14.7
@@ -8,2 +8,4 @@ /** | ||
*/ | ||
'use strict' | ||
var xyz = require('./xyz'); | ||
@@ -13,9 +15,5 @@ | ||
var cam = module.exports = { | ||
name: 'cam', | ||
name: 'cam', | ||
alias: ['ciecam', 'ciecam02'], | ||
xyz: function(cam){ | ||
//TODO | ||
} | ||
alias: ['ciecam', 'ciecam02'], | ||
}; | ||
@@ -28,2 +26,6 @@ | ||
//TODO | ||
}; | ||
}; | ||
cam.xyz = function () { | ||
} |
/** | ||
* @module color-space/cmy | ||
*/ | ||
'use strict' | ||
var rgb = require('./rgb'); | ||
@@ -52,2 +54,2 @@ | ||
]; | ||
}; | ||
}; |
/** | ||
* @module color-space/cmyk | ||
*/ | ||
'use strict' | ||
@@ -41,2 +42,2 @@ var rgb = require('./rgb'); | ||
return [c * 100, m * 100, y * 100, k * 100]; | ||
}; | ||
}; |
@@ -9,2 +9,3 @@ | ||
*/ | ||
'use strict' | ||
@@ -11,0 +12,0 @@ var xyy = require('./xyy'); |
@@ -6,2 +6,4 @@ /** | ||
*/ | ||
'use strict' | ||
var rgb = require('./rgb'); | ||
@@ -77,2 +79,2 @@ var clamp = require('mumath/clamp'); | ||
//TODO - there is no backwise conversion yet | ||
}; | ||
}; |
/** | ||
* @module color-space/hcg | ||
*/ | ||
'use strict' | ||
@@ -5,0 +6,0 @@ var rgb = require('./rgb'); |
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -88,2 +89,2 @@ var rgb = require('./rgb'); | ||
return [h * 180 / Math.PI, s * 100, i]; | ||
}; | ||
}; |
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -88,2 +89,2 @@ var rgb = require('./rgb'); | ||
return [h * 180 / Math.PI, s * 100, i]; | ||
}; | ||
}; |
/** | ||
* @module color-space/hsl | ||
*/ | ||
'use strict' | ||
@@ -106,2 +107,2 @@ var rgb = require('./rgb'); | ||
return [h, s * 100, l * 100]; | ||
}; | ||
}; |
/** | ||
* @module color-space/hsv | ||
*/ | ||
'use strict' | ||
@@ -115,2 +116,2 @@ var rgb = require('./rgb'); | ||
return [h, sv * 100, v * 100]; | ||
}; | ||
}; |
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -37,2 +38,2 @@ var xyz = require('./xyz'); | ||
return _husl._conv.lch.husl(xyz.lchuv(arg)); | ||
}; | ||
}; |
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -31,2 +32,2 @@ var xyz = require('./xyz'); | ||
lchuv.huslp = _husl._conv.lch.huslp; | ||
xyz.huslp = function(arg){return _husl._conv.lch.huslp(xyz.lchuv(arg));}; | ||
xyz.huslp = function(arg){return _husl._conv.lch.huslp(xyz.lchuv(arg));}; |
/** | ||
* @module color-space/hwb | ||
*/ | ||
'use strict' | ||
@@ -110,2 +111,2 @@ var rgb = require('./rgb'); | ||
return hsv.hwb(hsl.hsv(arg)); | ||
}; | ||
}; |
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
'use strict'; | ||
@@ -51,7 +52,6 @@ | ||
//build absent convertors from each to every space | ||
var fromSpace, toSpace; | ||
var fromSpace; | ||
for (var fromSpaceName in spaces) { | ||
fromSpace = spaces[fromSpaceName]; | ||
for (var toSpaceName in spaces) { | ||
toSpace = spaces[toSpaceName]; | ||
if (!fromSpace[toSpaceName]) fromSpace[toSpaceName] = getConvertor(fromSpaceName, toSpaceName); | ||
@@ -65,3 +65,2 @@ } | ||
var fromSpace = spaces[fromSpaceName]; | ||
var toSpace = spaces[toSpaceName]; | ||
@@ -90,2 +89,2 @@ //create straight converter | ||
module.exports = spaces; | ||
module.exports = spaces; |
@@ -8,2 +8,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -56,2 +57,2 @@ var rgb = require('./rgb'); | ||
] | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -60,2 +61,2 @@ var xyz = require('./xyz'); | ||
return [l, a, b]; | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -44,2 +45,2 @@ var xyz = require('./xyz'); | ||
return [l, a, b]; | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -56,2 +57,2 @@ var xyz = require('./xyz'); | ||
return lab.lchab(xyz.lab(arg)); | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -51,2 +52,2 @@ var luv = require('./luv'); | ||
return luv.lchuv(xyz.luv(arg)); | ||
}; | ||
}; |
@@ -13,2 +13,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -84,2 +85,2 @@ var xyz = require('./xyz'); | ||
]; | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -28,3 +29,3 @@ var xyz = require('./xyz'); | ||
//get constants | ||
var e = 0.008856451679035631; //(6/29)^3 | ||
//var e = 0.008856451679035631; //(6/29)^3 | ||
var k = 0.0011070564598794539; //(3/29)^3 | ||
@@ -101,2 +102,2 @@ | ||
return [l, u, v]; | ||
}; | ||
}; |
/** | ||
* @module color-space/munsell | ||
*/ | ||
'use strict' | ||
@@ -30,2 +31,2 @@ var munsell = { | ||
module.exports = munsell; | ||
module.exports = munsell; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -77,2 +78,2 @@ var xyz = require('./xyz'); | ||
module.exports = osaucs; | ||
module.exports = osaucs; |
{ | ||
"name": "color-space", | ||
"description": "Color space conversions and data", | ||
"version": "1.14.6", | ||
"version": "1.14.7", | ||
"author": "Deema Yvanow <dfcreative@gmail.com>", | ||
@@ -40,3 +40,3 @@ "keywords": [ | ||
"dependencies": { | ||
"husl": ">=5.0", | ||
"husl": "^5.0.0", | ||
"mumath": "^3.0.0" | ||
@@ -43,0 +43,0 @@ }, |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -14,2 +15,2 @@ module.exports = { | ||
alias: ['RGB'] | ||
}; | ||
}; |
13
tsl.js
@@ -9,2 +9,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -49,10 +50,10 @@ var rgb = require('./rgb'); | ||
r = Math.sqrt(5 * S*S / (9 * (1/x + 1))) + 1/3; | ||
g = Math.sqrt(5 * S*S / (9 * (x + 1))) + 1/3; | ||
var r = Math.sqrt(5 * S*S / (9 * (1/x + 1))) + 1/3; | ||
var g = Math.sqrt(5 * S*S / (9 * (x + 1))) + 1/3; | ||
var k = L / (.185 * r + .473 * g + .114); | ||
B = k * (1 - r - g); | ||
G = k * g; | ||
R = k * r; | ||
var B = k * (1 - r - g); | ||
var G = k * g; | ||
var R = k * r; | ||
@@ -87,2 +88,2 @@ return [ | ||
return [T, S, L]; | ||
}; | ||
}; |
@@ -8,5 +8,5 @@ /** | ||
*/ | ||
'use strict' | ||
var xyz = require('./xyz'); | ||
var luv = require('./luv'); | ||
@@ -59,2 +59,2 @@ var ucs = module.exports = { | ||
]; | ||
}; | ||
}; |
17
uvw.js
@@ -8,2 +8,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -106,10 +107,10 @@ var ucs = require('./ucs'); | ||
ucs.uvw = function(ucs) { | ||
//find chromacity variables | ||
var u = U / (U + V + W); | ||
var v = V / (U + V + W); | ||
// //find chromacity variables | ||
// var u = U / (U + V + W); | ||
// var v = V / (U + V + W); | ||
//find 1964 UVW | ||
w = 25 * Math.pow(y, 1/3) - 17; | ||
u = 13 * w * (u - un); | ||
v = 13 * w * (v - vn); | ||
}; | ||
// //find 1964 UVW | ||
// w = 25 * Math.pow(y, 1/3) - 17; | ||
// u = 13 * w * (u - un); | ||
// v = 13 * w * (v - vn); | ||
}; |
@@ -18,2 +18,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -87,2 +88,2 @@ var rgb = require('./rgb'); | ||
return ypbpr.xvycc(rgb.ypbpr(arr, kb, kr)); | ||
}; | ||
}; |
@@ -6,2 +6,4 @@ /** | ||
*/ | ||
'use strict' | ||
var xyz = require('./xyz'); | ||
@@ -38,2 +40,2 @@ | ||
module.exports = xyy; | ||
module.exports = xyy; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -144,2 +145,2 @@ var rgb = require('./rgb'); | ||
module.exports = xyz; | ||
module.exports = xyz; |
@@ -9,2 +9,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -78,2 +79,2 @@ var rgb = require('./rgb'); | ||
return ypbpr.ycbcr(rgb.ypbpr(arr, kb, kr)); | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -41,2 +42,2 @@ var rgb = require('./rgb'); | ||
return rgb.ypbpr(arr, 0.0593, 0.2627); | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -56,2 +57,2 @@ var rgb = require('./rgb'); | ||
]; | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -71,2 +72,2 @@ var rgb = require('./rgb'); | ||
] | ||
}; | ||
}; |
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -49,2 +50,2 @@ var rgb = require('./rgb'); | ||
]; | ||
}; | ||
}; |
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -50,2 +51,2 @@ var rgb = require('./rgb'); | ||
return [y, i, q]; | ||
}; | ||
}; |
@@ -11,2 +11,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -65,2 +66,2 @@ var rgb = require('./rgb'); | ||
return [y, pb, pr]; | ||
}; | ||
}; |
32
yuv.js
@@ -6,2 +6,3 @@ /** | ||
*/ | ||
'use strict' | ||
@@ -17,21 +18,22 @@ var rgb = require('./rgb'); | ||
rgb: function(yuv) { | ||
var y = yuv[0], | ||
u = yuv[1], | ||
v = yuv[2], | ||
r, g, b; | ||
}; | ||
r = (y * 1) + (u * 0) + (v * 1.13983); | ||
g = (y * 1) + (u * -0.39465) + (v * -0.58060); | ||
b = (y * 1) + (u * 2.02311) + (v * 0); | ||
yuv.rgb = function(yuv) { | ||
var y = yuv[0], | ||
u = yuv[1], | ||
v = yuv[2], | ||
r, g, b; | ||
r = Math.min(Math.max(0, r), 1); | ||
g = Math.min(Math.max(0, g), 1); | ||
b = Math.min(Math.max(0, b), 1); | ||
r = (y * 1) + (u * 0) + (v * 1.13983); | ||
g = (y * 1) + (u * -0.39465) + (v * -0.58060); | ||
b = (y * 1) + (u * 2.02311) + (v * 0); | ||
return [r * 255, g * 255, b * 255]; | ||
} | ||
}; | ||
r = Math.min(Math.max(0, r), 1); | ||
g = Math.min(Math.max(0, g), 1); | ||
b = Math.min(Math.max(0, b), 1); | ||
return [r * 255, g * 255, b * 255]; | ||
} | ||
//extend rgb | ||
@@ -48,2 +50,2 @@ rgb.yuv = function(rgb) { | ||
return [y, u, v]; | ||
}; | ||
}; |
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
68156
351786
2357
+ Addedhusl@5.0.3(transitive)
- Removedhusl@6.0.6(transitive)
Updatedhusl@^5.0.0