🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

colord

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colord - npm Package Compare versions

Comparing version

to
1.1.1

4

CHANGELOG.md

@@ -0,1 +1,5 @@

### 1.1.1
- Make bundle 1% lighter
### 1.1.0

@@ -2,0 +6,0 @@

2

index.d.ts
export { colord, Colord } from "./colord";
export { extend, Plugin } from "./extend";
export { RgbColor, RgbaColor, HslColor, HslaColor, HsvColor, HsvaColor, XyzColor, XyzaColor, AnyColor, } from "./types";
export { RgbColor, RgbaColor, HslColor, HslaColor, HsvColor, HsvaColor, XyzColor, XyzaColor, HwbColor, HwbaColor, AnyColor, } from "./types";

@@ -1,1 +0,1 @@

Object.defineProperty(exports,"__esModule",{value:!0});var r=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},t=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r<t?t:r},e=function(r){var t=r.g,e=r.b,u=r.a;return{r:n(r.r,0,255),g:n(t,0,255),b:n(e,0,255),a:n(u)}},u=function(r){return{r:t(r.r),g:t(r.g),b:t(r.b),a:t(r.a,2)}},a=/^\s*#?([0-9A-F]{3,4}){1,2}\s*$/i,o=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},i=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},s=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),b=a%6;return{r:255*[e,i,o,o,s,e][b],g:255*[s,e,e,i,o,o][b],b:255*[o,o,s,e,e,i][b],a:u}},b=function(r){var t=r.s,e=r.l,u=r.a;return{h:n(r.h,0,360),s:n(t,0,100),l:n(e,0,100),a:n(u)}},h=function(r){var n=r.s,e=r.l,u=r.a;return{h:t(r.h),s:t(n),l:t(e),a:t(u,2)}},f=function(r){return s((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},g=function(r){return{h:(t=i(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},p=/hsla?\(?s*(-?\d+\.?\d*),?\s*(-?\d+\.?\d*)%?,?\s*(-?\d+\.?\d*)%?,?\s*(-?\d*\.?\d+)?s*\)?/i,c=/rgba?\(?\s*(-?\d+),?\s*(-?\d+),?\s*(-?\d+),?\s*(-?\d*\.?\d+)?\s*\)?/i,l={string:[function(r){return a.test(r)?(r=r.replace("#","").trim()).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?parseInt(r[3]+r[3],16)/255:1}:{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?parseInt(r.substr(6,2),16)/255:1}:null},function(r){var t=c.exec(r);return t?e({r:Number(t[1]),g:Number(t[2]),b:Number(t[3]),a:void 0===t[4]?1:Number(t[4])}):null},function(r){var t=p.exec(r);if(!t)return null;var n=b({h:Number(t[1]),s:Number(t[2]),l:Number(t[3]),a:void 0===t[4]?1:Number(t[4])});return f(n)}],object:[function(t){var n=t.r,u=t.g,a=t.b,o=t.a,i=void 0===o?1:o;return r(n)&&r(u)&&r(a)?e({r:Number(n),g:Number(u),b:Number(a),a:Number(i)}):null},function(t){var n=t.h,e=t.s,u=t.l,a=t.a,o=void 0===a?1:a;if(!r(n)||!r(e)||!r(u))return null;var i=b({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},function(t){var e=t.h,u=t.s,a=t.v,o=t.a,i=void 0===o?1:o;if(!r(e)||!r(u)||!r(a))return null;var b=function(r){var t=r.s,e=r.v,u=r.a;return{h:n(r.h,0,360),s:n(t,0,100),v:n(e,0,100),a:n(u)}}({h:Number(e),s:Number(u),v:Number(a),a:Number(i)});return s(b)}]},v=function(r,t){for(var n=0;n<t.length;n++){var e=t[n](r);if(e)return e}return null},d=function(r,t){var e=g(r),u=e.l,a=e.a;return{h:e.h,s:n(e.s+100*t,0,100),l:u,a:a}},m=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},y=function(r,t){var e=g(r),u=e.a;return{h:e.h,s:e.s,l:n(e.l+100*t,0,100),a:u}},N=function(){function r(r){this.parsed=function(r){return"string"==typeof r?v(r,l.string):"object"==typeof r&&null!==r?v(r,l.object):null}(r),this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return t(m(this.rgba),2)},r.prototype.isDark=function(){return m(this.rgba)<.5},r.prototype.isLight=function(){return m(this.rgba)>=.5},r.prototype.toHex=function(){return r=u(this.rgba),n=r.r,e=r.g,a=r.b,s=(i=r.a)<1?o(t(255*i)):"","#"+o(n)+o(e)+o(a)+s;var r,n,e,a,i,s},r.prototype.toRgb=function(){return u(this.rgba)},r.prototype.toRgbString=function(){return r=u(this.rgba),t=r.r,n=r.g,e=r.b,(a=r.a)<1?"rgba("+t+", "+n+", "+e+", "+a+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,a},r.prototype.toHsl=function(){return h(g(this.rgba))},r.prototype.toHslString=function(){return r=h(g(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=i(this.rgba),n=r.s,e=r.v,u=r.a,{h:t(r.h),s:t(n),v:t(e),a:t(u,2)};var r,n,e,u},r.prototype.invert=function(){return x({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),x(d(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),x(d(this.rgba,-r))},r.prototype.grayscale=function(){return x(d(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),x(y(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),x(y(this.rgba,-r))},r.prototype.alpha=function(r){return"number"==typeof r?x({r:(n=this.rgba).r,g:n.g,b:n.b,a:r}):t(this.rgba.a,2);var n},r}(),x=function(r){return r instanceof N?r:new N(r)},I=[];exports.Colord=N,exports.colord=x,exports.extend=function(r){r.forEach(function(r){I.indexOf(r)<0&&(r(N,l),I.push(r))})};
Object.defineProperty(exports,"__esModule",{value:!0});var r=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},t=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r<t?t:r},e=function(r){return{r:n(r.r,0,255),g:n(r.g,0,255),b:n(r.b,0,255),a:n(r.a)}},u=function(r){return{r:t(r.r),g:t(r.g),b:t(r.b),a:t(r.a,2)}},o=/^\s*#?([0-9A-F]{3,4}){1,2}\s*$/i,a=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},i=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,o=Math.max(t,n,e),a=o-Math.min(t,n,e),i=a?o===t?(n-e)/a:o===n?2+(e-t)/a:4+(t-n)/a:0;return{h:60*(i<0?i+6:i),s:o?a/o*100:0,v:o/255*100,a:u}},s=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var o=Math.floor(t),a=e*(1-n),i=e*(1-(t-o)*n),s=e*(1-(1-t+o)*n),b=o%6;return{r:255*[e,i,a,a,s,e][b],g:255*[s,e,e,i,a,a][b],b:255*[a,a,s,e,e,i][b],a:u}},b=function(r){return{h:n(r.h,0,360),s:n(r.s,0,100),l:n(r.l,0,100),a:n(r.a)}},h=function(r){return{h:t(r.h),s:t(r.s),l:t(r.l),a:t(r.a,2)}},f=function(r){return s((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},g=function(r){return{h:(t=i(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},p=/hsla?\(?s*(-?\d+\.?\d*),?\s*(-?\d+\.?\d*)%?,?\s*(-?\d+\.?\d*)%?,?\s*(-?\d*\.?\d+)?s*\)?/i,c=/rgba?\(?\s*(-?\d+),?\s*(-?\d+),?\s*(-?\d+),?\s*(-?\d*\.?\d+)?\s*\)?/i,l={string:[function(r){return o.test(r)?(r=r.replace("#","").trim()).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?parseInt(r[3]+r[3],16)/255:1}:{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?parseInt(r.substr(6,2),16)/255:1}:null},function(r){var t=c.exec(r);return t?e({r:Number(t[1]),g:Number(t[2]),b:Number(t[3]),a:void 0===t[4]?1:Number(t[4])}):null},function(r){var t=p.exec(r);if(!t)return null;var n=b({h:Number(t[1]),s:Number(t[2]),l:Number(t[3]),a:void 0===t[4]?1:Number(t[4])});return f(n)}],object:[function(t){var n=t.r,u=t.g,o=t.b,a=t.a,i=void 0===a?1:a;return r(n)&&r(u)&&r(o)?e({r:Number(n),g:Number(u),b:Number(o),a:Number(i)}):null},function(t){var n=t.h,e=t.s,u=t.l,o=t.a,a=void 0===o?1:o;if(!r(n)||!r(e)||!r(u))return null;var i=b({h:Number(n),s:Number(e),l:Number(u),a:Number(a)});return f(i)},function(t){var e=t.h,u=t.s,o=t.v,a=t.a,i=void 0===a?1:a;if(!r(e)||!r(u)||!r(o))return null;var b=function(r){return{h:n(r.h,0,360),s:n(r.s,0,100),v:n(r.v,0,100),a:n(r.a)}}({h:Number(e),s:Number(u),v:Number(o),a:Number(i)});return s(b)}]},v=function(r,t){for(var n=0;n<t.length;n++){var e=t[n](r);if(e)return e}return null},d=function(r,t){var e=g(r);return{h:e.h,s:n(e.s+100*t,0,100),l:e.l,a:e.a}},m=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},y=function(r,t){var e=g(r);return{h:e.h,s:e.s,l:n(e.l+100*t,0,100),a:e.a}},N=function(){function r(r){this.parsed=function(r){return"string"==typeof r?v(r,l.string):"object"==typeof r&&null!==r?v(r,l.object):null}(r),this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return t(m(this.rgba),2)},r.prototype.isDark=function(){return m(this.rgba)<.5},r.prototype.isLight=function(){return m(this.rgba)>=.5},r.prototype.toHex=function(){return r=u(this.rgba),n=r.r,e=r.g,o=r.b,s=(i=r.a)<1?a(t(255*i)):"","#"+a(n)+a(e)+a(o)+s;var r,n,e,o,i,s},r.prototype.toRgb=function(){return u(this.rgba)},r.prototype.toRgbString=function(){return r=u(this.rgba),t=r.r,n=r.g,e=r.b,(o=r.a)<1?"rgba("+t+", "+n+", "+e+", "+o+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,o},r.prototype.toHsl=function(){return h(g(this.rgba))},r.prototype.toHslString=function(){return r=h(g(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=i(this.rgba),{h:t(r.h),s:t(r.s),v:t(r.v),a:t(r.a,2)};var r},r.prototype.invert=function(){return x({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),x(d(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),x(d(this.rgba,-r))},r.prototype.grayscale=function(){return x(d(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),x(y(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),x(y(this.rgba,-r))},r.prototype.alpha=function(r){return"number"==typeof r?x({r:(n=this.rgba).r,g:n.g,b:n.b,a:r}):t(this.rgba.a,2);var n},r}(),x=function(r){return r instanceof N?r:new N(r)},I=[];exports.Colord=N,exports.colord=x,exports.extend=function(r){r.forEach(function(r){I.indexOf(r)<0&&(r(N,l),I.push(r))})};
{
"name": "colord",
"version": "1.1.0",
"version": "1.1.1",
"description": "👑 A tiny yet powerful tool for high-performance color manipulations and conversions",

@@ -5,0 +5,0 @@ "keywords": [

@@ -1,1 +0,1 @@

var o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},t=function(t){var r=t.g,n=t.b;return.2126*o(t.r)+.7152*o(r)+.0722*o(n)};module.exports=function(o){o.prototype.luminance=function(){return o=t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=t(e),d=t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}};
var o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},t=function(t){return.2126*o(t.r)+.7152*o(t.g)+.0722*o(t.b)};module.exports=function(o){o.prototype.luminance=function(){return o=t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,i,a,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=t(e),d=t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(i=2)&&(i=0),void 0===a&&(a=Math.pow(10,i)),Math.floor(a*n)/a},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(a=(r=t).size)?"normal":a,"AAA"===(i=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===i&&"large"===e?3:4.5);var r,n,i,a,e}};

@@ -1,1 +0,1 @@

var r=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=Math.pow(10,n)),Math.round(t*r)/t},t=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=1),r>t?t:r<n?n:r},a=function(r){return{h:function(r){var n=r.r,t=r.g,a=r.b,u=r.a,o=Math.max(n,t,a),e=o-Math.min(n,t,a),h=e?o===n?(t-a)/e:o===t?2+(a-n)/e:4+(n-t)/e:0;return{h:60*(h<0?h+6:h),s:o?e/o*100:0,v:o/255*100,a:u}}(r).h,w:Math.min(r.r,r.g,r.b)/255*100,b:100-Math.max(r.r,r.g,r.b)/255*100,a:r.a}},u=function(r){var n=r.b;return function(r){var n=r.h,t=r.s,a=r.v,u=r.a;n=n/360*6,t/=100,a/=100;var o=Math.floor(n),e=a*(1-t),h=a*(1-(n-o)*t),i=a*(1-(1-n+o)*t),b=o%6;return{r:255*[a,h,e,e,i,a][b],g:255*[i,a,a,h,e,e][b],b:255*[e,e,i,a,a,h][b],a:u}}({h:r.h,s:100===n?0:100-r.w/(100-n)*100,v:100-n,a:r.a})},o=function(n){var a=n.h,o=n.w,e=n.b,h=n.a,i=void 0===h?1:h;if(!r(a)||!r(o)||!r(e))return null;var b=function(r){var n=r.w,a=r.b,u=r.a;return{h:t(r.h,0,360),w:t(n,0,100),b:t(a,0,100),a:t(u)}}({h:Number(a),w:Number(o),b:Number(e),a:Number(i)});return u(b)};module.exports=function(r,t){r.prototype.toHwb=function(){return r=a(this.rgba),{h:n(r.h),w:n(r.w),b:n(r.b),a:n(r.a,2)};var r},t.object.push(o)};
var r=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=Math.pow(10,n)),Math.round(t*r)/t},t=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=1),r>t?t:r<n?n:r},a=function(r){return{h:function(r){var n=r.r,t=r.g,a=r.b,u=r.a,o=Math.max(n,t,a),e=o-Math.min(n,t,a),b=e?o===n?(t-a)/e:o===t?2+(a-n)/e:4+(n-t)/e:0;return{h:60*(b<0?b+6:b),s:o?e/o*100:0,v:o/255*100,a:u}}(r).h,w:Math.min(r.r,r.g,r.b)/255*100,b:100-Math.max(r.r,r.g,r.b)/255*100,a:r.a}},u=function(r){return function(r){var n=r.h,t=r.s,a=r.v,u=r.a;n=n/360*6,t/=100,a/=100;var o=Math.floor(n),e=a*(1-t),b=a*(1-(n-o)*t),h=a*(1-(1-n+o)*t),i=o%6;return{r:255*[a,b,e,e,h,a][i],g:255*[h,a,a,b,e,e][i],b:255*[e,e,h,a,a,b][i],a:u}}({h:r.h,s:100===r.b?0:100-r.w/(100-r.b)*100,v:100-r.b,a:r.a})},o=function(n){var a=n.h,o=n.w,e=n.b,b=n.a,h=void 0===b?1:b;if(!r(a)||!r(o)||!r(e))return null;var i=function(r){return{h:t(r.h,0,360),w:t(r.w,0,100),b:t(r.b,0,100),a:t(r.a)}}({h:Number(a),w:Number(o),b:Number(e),a:Number(h)});return u(i)};module.exports=function(r,t){r.prototype.toHwb=function(){return r=a(this.rgba),{h:n(r.h),w:n(r.w),b:n(r.b),a:n(r.a,2)};var r},t.object.push(o)};

@@ -1,1 +0,1 @@

var r=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=Math.pow(10,n)),Math.round(t*r)/t},t=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=1),r>t?t:r<n?n:r},u=function(r){var n=r/255;return n<.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)},o=function(r){return 255*(r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r)},a=function(r){var n=r.y,u=r.z,o=r.a;return{x:t(r.x,0,95.047),y:t(n,0,100),z:t(u,0,108.883),a:t(o)}},e=function(n){var t=n.x,u=n.y,o=n.z,e=n.a,f=void 0===e?1:e;if(!r(t)||!r(u)||!r(o))return null;var v=a({x:Number(t),y:Number(u),z:Number(o),a:Number(f)});return i(v)},i=function(r){var n,u,a,e,i=r.x/100,f=r.y/100,v=r.z/100;return n={r:o(3.2404542*i-1.5371385*f-.4985314*v),g:o(-.969266*i+1.8760108*f+.041556*v),b:o(.0556434*i-.2040259*f+1.0572252*v),a:r.a},u=n.g,a=n.b,e=n.a,{r:t(n.r,0,255),g:t(u,0,255),b:t(a,0,255),a:t(e)}};module.exports=function(r,t){r.prototype.toXyz=function(){return function(r){var t=r.y,u=r.z,o=r.a;return{x:n(r.x,3),y:n(t,3),z:n(u,3),a:n(o,2)}}((t=(r=this.rgba).g,o=r.b,e=r.a,i=u(r.r),f=u(t),v=u(o),a({x:100*(.4124564*i+.3575761*f+.1804375*v),y:100*(.2126729*i+.7151522*f+.072175*v),z:100*(.0193339*i+.119192*f+.9503041*v),a:e})));var r,t,o,e,i,f,v},t.object.push(e)};
var r=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=Math.pow(10,n)),Math.round(t*r)/t},t=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=1),r>t?t:r<n?n:r},u=function(r){var n=r/255;return n<.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)},o=function(r){return 255*(r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r)},a=function(r){return{x:t(r.x,0,95.047),y:t(r.y,0,100),z:t(r.z,0,108.883),a:t(r.a)}},e=function(n){var t=n.x,u=n.y,o=n.z,e=n.a,f=void 0===e?1:e;if(!r(t)||!r(u)||!r(o))return null;var y=a({x:Number(t),y:Number(u),z:Number(o),a:Number(f)});return i(y)},i=function(r){var n,u=r.x/100,a=r.y/100,e=r.z/100;return n={r:o(3.2404542*u-1.5371385*a-.4985314*e),g:o(-.969266*u+1.8760108*a+.041556*e),b:o(.0556434*u-.2040259*a+1.0572252*e),a:r.a},{r:t(n.r,0,255),g:t(n.g,0,255),b:t(n.b,0,255),a:t(n.a)}};module.exports=function(r,t){r.prototype.toXyz=function(){return o=u((t=this.rgba).r),e=u(t.g),i=u(t.b),r=a({x:100*(.4124564*o+.3575761*e+.1804375*i),y:100*(.2126729*o+.7151522*e+.072175*i),z:100*(.0193339*o+.119192*e+.9503041*i),a:t.a}),{x:n(r.x,3),y:n(r.y,3),z:n(r.z,3),a:n(r.a,2)};var r,t,o,e,i},t.object.push(e)};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet