You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

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

Comparing version 1.5.0 to 1.6.0

4

CHANGELOG.md

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

### 1.6.0
- Improvement: You can now use every angle unit supported by CSS (`deg`, `rad`, `grad`, `turn`).
### 1.5.0

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

@@ -11,1 +11,11 @@ export declare const isPresent: (value: unknown) => boolean;

export declare const clamp: (number: number, min?: number, max?: number) => number;
/**
* Processes and clamps a degree (angle) value properly.
* Any `NaN` or `Infinity` will be converted to `0`.
* Examples: -1 => 359, 361 => 1
*/
export declare const clampHue: (degrees: number) => number;
/**
* Converts a hue value to degrees from 0 to 360 inclusive.
*/
export declare const parseHue: (value: string, unit?: string) => number;

2

index.js

@@ -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?r:t},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,8})\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*)(deg)?[,\s]+(-?\d+\.?\d*)%?[,\s]+(-?\d+\.?\d*)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,c=/rgba?\(?\s*(-?\d+\.?\d*)(%)?[,\s]+(-?\d+\.?\d*)(%)?[,\s]+(-?\d+\.?\d*)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,l={string:[function(r){var t=o.exec(r);return t?(r=t[1]).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}:6===r.length||8===r.length?{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:null},function(r){var t=c.exec(r);return t?e({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},function(r){var t=p.exec(r);if(!t)return null;var n=b({h:Number(t[1]),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});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)},M=[];exports.Colord=N,exports.colord=x,exports.extend=function(r){r.forEach(function(r){M.indexOf(r)<0&&(r(N,l),M.push(r))})},exports.random=function(){return new N({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
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+0},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},e=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},u={grad:.9,turn:360,rad:360/(2*Math.PI)},a=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)}},o=function(r){return{r:t(r.r),g:t(r.g),b:t(r.b),a:t(r.a,2)}},i=/^\s*#?([0-9a-f]{3,8})\s*$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},b=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}},h=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}},g=function(r){return{h:e(r.h),s:n(r.s,0,100),l:n(r.l,0,100),a:n(r.a)}},f=function(r){return{h:t(r.h),s:t(r.s),l:t(r.l),a:t(r.a,2)}},c=function(r){return h((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},p=function(r){return{h:(t=b(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},l=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,d=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,v={string:[function(r){var t=i.exec(r);return t?(r=t[1]).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}:6===r.length||8===r.length?{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:null},function(r){var t=d.exec(r);return t?a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},function(r){var t=l.exec(r);if(!t)return null;var n,e,a=g({h:(n=t[1],e=t[2],void 0===e&&(e="deg"),Number(n)*(u[e]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return c(a)}],object:[function(t){var n=t.r,e=t.g,u=t.b,o=t.a,i=void 0===o?1:o;return r(n)&&r(e)&&r(u)?a({r:Number(n),g:Number(e),b:Number(u),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=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return c(i)},function(t){var u=t.h,a=t.s,o=t.v,i=t.a,s=void 0===i?1:i;if(!r(u)||!r(a)||!r(o))return null;var b=function(r){return{h:e(r.h),s:n(r.s,0,100),v:n(r.v,0,100),a:n(r.a)}}({h:Number(u),s:Number(a),v:Number(o),a:Number(s)});return h(b)}]},m=function(r,t){for(var n=0;n<t.length;n++){var e=t[n](r);if(e)return e}return null},y=function(r,t){var e=p(r);return{h:e.h,s:n(e.s+100*t,0,100),l:e.l,a:e.a}},N=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},x=function(r,t){var e=p(r);return{h:e.h,s:e.s,l:n(e.l+100*t,0,100),a:e.a}},M=function(){function r(r){this.parsed=function(r){return"string"==typeof r?m(r,v.string):"object"==typeof r&&null!==r?m(r,v.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(N(this.rgba),2)},r.prototype.isDark=function(){return N(this.rgba)<.5},r.prototype.isLight=function(){return N(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),n=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(t(255*a)):"","#"+s(n)+s(e)+s(u)+i;var r,n,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return f(p(this.rgba))},r.prototype.toHslString=function(){return r=f(p(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=b(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 I({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),I(y(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),I(y(this.rgba,-r))},r.prototype.grayscale=function(){return I(y(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),I(x(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),I(x(this.rgba,-r))},r.prototype.alpha=function(r){return"number"==typeof r?I({r:(n=this.rgba).r,g:n.g,b:n.b,a:r}):t(this.rgba.a,2);var n},r}(),I=function(r){return r instanceof M?r:new M(r)},j=[];exports.Colord=M,exports.colord=I,exports.extend=function(r){r.forEach(function(r){j.indexOf(r)<0&&(r(M,v),j.push(r))})},exports.random=function(){return new M({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};
{
"name": "colord",
"version": "1.5.0",
"version": "1.6.0",
"description": "👑 A tiny yet powerful tool for high-performance color manipulations and conversions",

@@ -123,3 +123,3 @@ "keywords": [

"path": "dist/plugins/lch.mjs",
"limit": "1.25 KB"
"limit": "1.5 KB"
},

@@ -126,0 +126,0 @@ {

@@ -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){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}};
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+0;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+0},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?r:n},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)};
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+0},t=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=1),r>t?t:r>n?r:n},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 a=function(a){return"string"==typeof a?a.length>0:"number"==typeof a},r=function(a,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*a)/t},t=function(a,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),a>t?t:a>r?a:r},n=function(a){var r=a/255;return r<.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)},u=function(a){return 255*(a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a)},o=96.422,e=100,b=82.521,h=function(a){var r,n=function(a){return{x:.9555766*a.x+-.0230393*a.y+.0631636*a.z,y:-.0282895*a.x+1.0099416*a.y+.0210077*a.z,z:.0122982*a.x+-.020483*a.y+1.3299098*a.z,a:a.a}}(a),o=n.x/100,e=n.y/100,b=n.z/100;return r={r:u(3.2404542*o-1.5371385*e-.4985314*b),g:u(-.969266*o+1.8760108*e+.041556*b),b:u(.0556434*o-.2040259*e+1.0572252*b),a:n.a},{r:t(r.r,0,255),g:t(r.g,0,255),b:t(r.b,0,255),a:t(r.a)}},i=function(a){var r=n(a.r),u=n(a.g),h=n(a.b);return function(a){return{x:t(a.x,0,o),y:t(a.y,0,e),z:t(a.z,0,b),a:t(a.a)}}(function(a){return{x:1.0478112*a.x+.0228866*a.y+-.050127*a.z,y:.0295424*a.x+.9904844*a.y+-.0170491*a.z,z:-.0092345*a.x+.0150436*a.y+.7521316*a.z,a:a.a}}({x:100*(.4124564*r+.3575761*u+.1804375*h),y:100*(.2126729*r+.7151522*u+.072175*h),z:100*(.0193339*r+.119192*u+.9503041*h),a:a.a}))},l=216/24389,p=24389/27,c=function(r){var n=r.l,u=r.a,o=r.b,e=r.alpha,b=void 0===e?1:e;if(!a(n)||!a(u)||!a(o))return null;var h=function(a){return{l:t(a.l,0,100),a:t(a.a,-128,128),b:t(a.b,-128,128),alpha:t(a.alpha)}}({l:Number(n),a:Number(u),b:Number(o),alpha:Number(b)});return f(h)},f=function(a){var r=(a.l+16)/116,t=a.a/500+r,n=r-a.b/200;return h({x:(Math.pow(t,3)>l?Math.pow(t,3):(116*t-16)/p)*o,y:(a.l>8?Math.pow((a.l+16)/116,3):a.l/p)*e,z:(Math.pow(n,3)>l?Math.pow(n,3):(116*n-16)/p)*b,a:a.alpha})};module.exports=function(a,t){a.prototype.toLab=function(){return t=i(this.rgba),u=t.y/e,h=t.z/b,n=(n=t.x/o)>l?Math.cbrt(n):(p*n+16)/116,a={l:116*(u=u>l?Math.cbrt(u):(p*u+16)/116)-16,a:500*(n-u),b:200*(u-(h=h>l?Math.cbrt(h):(p*h+16)/116)),alpha:t.a},{l:r(a.l,2),a:r(a.a,2)+0,b:r(a.b,2)+0,alpha:r(a.alpha,2)};var a,t,n,u,h},t.object.push(c)};
var a=function(a){return"string"==typeof a?a.length>0:"number"==typeof a},r=function(a,r,t){return void 0===r&&(r=0),void 0===t&&(t=Math.pow(10,r)),Math.round(t*a)/t+0},t=function(a,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),a>t?t:a>r?a:r},n=function(a){var r=a/255;return r<.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)},u=function(a){return 255*(a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a)},o=96.422,e=100,b=82.521,h=function(a){var r,n,o={x:.9555766*(r=a).x+-.0230393*r.y+.0631636*r.z,y:-.0282895*r.x+1.0099416*r.y+.0210077*r.z,z:.0122982*r.x+-.020483*r.y+1.3299098*r.z};return n={r:u(.032404542*o.x-.015371385*o.y-.004985314*o.z),g:u(-.00969266*o.x+.018760108*o.y+41556e-8*o.z),b:u(556434e-9*o.x-.002040259*o.y+.010572252*o.z),a:a.a},{r:t(n.r,0,255),g:t(n.g,0,255),b:t(n.b,0,255),a:t(n.a)}},l=function(a){var r=n(a.r),u=n(a.g),h=n(a.b);return function(a){return{x:t(a.x,0,o),y:t(a.y,0,e),z:t(a.z,0,b),a:t(a.a)}}(function(a){return{x:1.0478112*a.x+.0228866*a.y+-.050127*a.z,y:.0295424*a.x+.9904844*a.y+-.0170491*a.z,z:-.0092345*a.x+.0150436*a.y+.7521316*a.z,a:a.a}}({x:100*(.4124564*r+.3575761*u+.1804375*h),y:100*(.2126729*r+.7151522*u+.072175*h),z:100*(.0193339*r+.119192*u+.9503041*h),a:a.a}))},i=216/24389,p=24389/27,y=function(r){var n=r.l,u=r.a,o=r.b,e=r.alpha,b=void 0===e?1:e;if(!a(n)||!a(u)||!a(o))return null;var h=function(a){return{l:t(a.l,0,100),a:t(a.a,-128,128),b:t(a.b,-128,128),alpha:t(a.alpha)}}({l:Number(n),a:Number(u),b:Number(o),alpha:Number(b)});return c(h)},c=function(a){var r=(a.l+16)/116,t=a.a/500+r,n=r-a.b/200;return h({x:(Math.pow(t,3)>i?Math.pow(t,3):(116*t-16)/p)*o,y:(a.l>8?Math.pow((a.l+16)/116,3):a.l/p)*e,z:(Math.pow(n,3)>i?Math.pow(n,3):(116*n-16)/p)*b,a:a.alpha})};module.exports=function(a,t){a.prototype.toLab=function(){return t=l(this.rgba),u=t.y/e,h=t.z/b,n=(n=t.x/o)>i?Math.cbrt(n):(p*n+16)/116,a={l:116*(u=u>i?Math.cbrt(u):(p*u+16)/116)-16,a:500*(n-u),b:200*(u-(h=h>i?Math.cbrt(h):(p*h+16)/116)),alpha:t.a},{l:r(a.l,2),a:r(a.a,2),b:r(a.b,2),alpha:r(a.alpha,2)};var a,t,n,u,h},t.object.push(y)};

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

var t=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},r=function(t,r,a){return void 0===r&&(r=0),void 0===a&&(a=Math.pow(10,r)),Math.round(a*t)/a},a=function(t,r,a){return void 0===r&&(r=0),void 0===a&&(a=1),t>a?a:t>r?t:r},n=function(t){var r=t/255;return r<.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)},u=function(t){return 255*(t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t)},o=96.422,h=100,c=82.521,e=function(t){var r,n=function(t){return{x:.9555766*t.x+-.0230393*t.y+.0631636*t.z,y:-.0282895*t.x+1.0099416*t.y+.0210077*t.z,z:.0122982*t.x+-.020483*t.y+1.3299098*t.z,a:t.a}}(t),o=n.x/100,h=n.y/100,c=n.z/100;return r={r:u(3.2404542*o-1.5371385*h-.4985314*c),g:u(-.969266*o+1.8760108*h+.041556*c),b:u(.0556434*o-.2040259*h+1.0572252*c),a:n.a},{r:a(r.r,0,255),g:a(r.g,0,255),b:a(r.b,0,255),a:a(r.a)}},i=function(t){var r=n(t.r),u=n(t.g),e=n(t.b);return function(t){return{x:a(t.x,0,o),y:a(t.y,0,h),z:a(t.z,0,c),a:a(t.a)}}(function(t){return{x:1.0478112*t.x+.0228866*t.y+-.050127*t.z,y:.0295424*t.x+.9904844*t.y+-.0170491*t.z,z:-.0092345*t.x+.0150436*t.y+.7521316*t.z,a:t.a}}({x:100*(.4124564*r+.3575761*u+.1804375*e),y:100*(.2126729*r+.7151522*u+.072175*e),z:100*(.0193339*r+.119192*u+.9503041*e),a:t.a}))},l=216/24389,f=24389/27,b=function(t){return{l:a(t.l,0,100),c:t.c,h:a(t.h,0,360),a:t.a}},p=function(t){return{l:r(t.l,2),c:r(t.c,2),h:r(t.h,2),a:r(t.a,2)}},M=function(r){var a=r.l,n=r.c,u=r.h,o=r.a,h=void 0===o?1:o;if(!t(a)||!t(n)||!t(u))return null;var c=b({l:Number(a),c:Number(n),h:Number(u),a:Number(h)});return y(c)},v=function(t){var a=function(t){var r=i(t),a=r.x/o,n=r.y/h,u=r.z/c;return a=a>l?Math.cbrt(a):(f*a+16)/116,{l:116*(n=n>l?Math.cbrt(n):(f*n+16)/116)-16,a:500*(a-n),b:200*(n-(u=u>l?Math.cbrt(u):(f*u+16)/116)),alpha:r.a}}(t),n=r(a.a,3)+0,u=r(a.b,3)+0,e=Math.atan2(u,n)/Math.PI*180;return{l:a.l,c:Math.sqrt(n*n+u*u),h:e<0?e+360:e,a:a.alpha}},y=function(t){return r={l:t.l,a:t.c*Math.cos(t.h*Math.PI/180),b:t.c*Math.sin(t.h*Math.PI/180),alpha:t.a},n=r.a/500+(a=(r.l+16)/116),u=a-r.b/200,e({x:(Math.pow(n,3)>l?Math.pow(n,3):(116*n-16)/f)*o,y:(r.l>8?Math.pow((r.l+16)/116,3):r.l/f)*h,z:(Math.pow(u,3)>l?Math.pow(u,3):(116*u-16)/f)*c,a:r.alpha});var r,a,n,u},d=/lcha?\(?\s*(-?\d+\.?\d*)%?[,\s]+(-?\d+\.?\d*)[,\s]+(-?\d+\.?\d*),?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,s=function(t){var r=d.exec(t);if(!r)return null;var a=b({l:Number(r[1]),c:Number(r[2]),h:Number(r[3]),a:void 0===r[4]?1:Number(r[4])/(r[5]?100:1)});return y(a)};module.exports=function(t,r){t.prototype.toLch=function(){return p(v(this.rgba))},t.prototype.toLchString=function(){return t=p(v(this.rgba)),r=t.l,a=t.c,n=t.h,(u=t.a)<1?"lch("+r+"% "+a+" "+n+" / "+u+")":"lch("+r+"% "+a+" "+n+")";var t,r,a,n,u},r.string.push(s),r.object.push(M)};
var r=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},t=function(r,t,a){return void 0===t&&(t=0),void 0===a&&(a=Math.pow(10,t)),Math.round(a*r)/a+0},a=function(r,t,a){return void 0===t&&(t=0),void 0===a&&(a=1),r>a?a:r>t?r:t},n={grad:.9,turn:360,rad:360/(2*Math.PI)},u=function(r){var t=r/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},o=function(r){return 255*(r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r)},h=96.422,e=100,c=82.521,i=function(r){var t,n,u={x:.9555766*(t=r).x+-.0230393*t.y+.0631636*t.z,y:-.0282895*t.x+1.0099416*t.y+.0210077*t.z,z:.0122982*t.x+-.020483*t.y+1.3299098*t.z};return n={r:o(.032404542*u.x-.015371385*u.y-.004985314*u.z),g:o(-.00969266*u.x+.018760108*u.y+41556e-8*u.z),b:o(556434e-9*u.x-.002040259*u.y+.010572252*u.z),a:r.a},{r:a(n.r,0,255),g:a(n.g,0,255),b:a(n.b,0,255),a:a(n.a)}},l=function(r){var t=u(r.r),n=u(r.g),o=u(r.b);return function(r){return{x:a(r.x,0,h),y:a(r.y,0,e),z:a(r.z,0,c),a:a(r.a)}}(function(r){return{x:1.0478112*r.x+.0228866*r.y+-.050127*r.z,y:.0295424*r.x+.9904844*r.y+-.0170491*r.z,z:-.0092345*r.x+.0150436*r.y+.7521316*r.z,a:r.a}}({x:100*(.4124564*t+.3575761*n+.1804375*o),y:100*(.2126729*t+.7151522*n+.072175*o),z:100*(.0193339*t+.119192*n+.9503041*o),a:r.a}))},b=216/24389,d=24389/27,f=function(r){return{l:a(r.l,0,100),c:r.c,h:(t=r.h,(t=isFinite(t)?t%360:0)>0?t:t+360),a:r.a};var t},p=function(r){return{l:t(r.l,2),c:t(r.c,2),h:t(r.h,2),a:t(r.a,2)}},v=function(t){var a=t.l,n=t.c,u=t.h,o=t.a,h=void 0===o?1:o;if(!r(a)||!r(n)||!r(u))return null;var e=f({l:Number(a),c:Number(n),h:Number(u),a:Number(h)});return M(e)},y=function(r){var a=function(r){var t=l(r),a=t.x/h,n=t.y/e,u=t.z/c;return a=a>b?Math.cbrt(a):(d*a+16)/116,{l:116*(n=n>b?Math.cbrt(n):(d*n+16)/116)-16,a:500*(a-n),b:200*(n-(u=u>b?Math.cbrt(u):(d*u+16)/116)),alpha:t.a}}(r),n=t(a.a,3),u=t(a.b,3),o=Math.atan2(u,n)/Math.PI*180;return{l:a.l,c:Math.sqrt(n*n+u*u),h:o<0?o+360:o,a:a.alpha}},M=function(r){return t={l:r.l,a:r.c*Math.cos(r.h*Math.PI/180),b:r.c*Math.sin(r.h*Math.PI/180),alpha:r.a},n=t.a/500+(a=(t.l+16)/116),u=a-t.b/200,i({x:(Math.pow(n,3)>b?Math.pow(n,3):(116*n-16)/d)*h,y:(t.l>8?Math.pow((t.l+16)/116,3):t.l/d)*e,z:(Math.pow(u,3)>b?Math.pow(u,3):(116*u-16)/d)*c,a:t.alpha});var t,a,n,u},x=/lcha?\(?\s*(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)[,\s]+(-?\d*\.?\d+)(deg|rad|grad|turn)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,s=function(r){var t=x.exec(r);if(!t)return null;var a,u,o=f({l:Number(t[1]),c:Number(t[2]),h:(a=t[3],u=t[4],void 0===u&&(u="deg"),Number(a)*(n[u]||1)),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return M(o)};module.exports=function(r,t){r.prototype.toLch=function(){return p(y(this.rgba))},r.prototype.toLchString=function(){return r=p(y(this.rgba)),t=r.l,a=r.c,n=r.h,(u=r.a)<1?"lch("+t+"% "+a+" "+n+" / "+u+")":"lch("+t+"% "+a+" "+n+")";var r,t,a,n,u},t.string.push(s),t.object.push(v)};

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

var a=function(a,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),a>n?n:a>t?a:t},t=function(a){var t=a/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},n=function(a){return 255*(a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a)},r=96.422,o=100,u=82.521,i=function(t){var r,o=function(a){return{x:.9555766*a.x+-.0230393*a.y+.0631636*a.z,y:-.0282895*a.x+1.0099416*a.y+.0210077*a.z,z:.0122982*a.x+-.020483*a.y+1.3299098*a.z,a:a.a}}(t),u=o.x/100,i=o.y/100,e=o.z/100;return r={r:n(3.2404542*u-1.5371385*i-.4985314*e),g:n(-.969266*u+1.8760108*i+.041556*e),b:n(.0556434*u-.2040259*i+1.0572252*e),a:o.a},{r:a(r.r,0,255),g:a(r.g,0,255),b:a(r.b,0,255),a:a(r.a)}},e=function(n){var i=t(n.r),e=t(n.g),h=t(n.b);return function(t){return{x:a(t.x,0,r),y:a(t.y,0,o),z:a(t.z,0,u),a:a(t.a)}}(function(a){return{x:1.0478112*a.x+.0228866*a.y+-.050127*a.z,y:.0295424*a.x+.9904844*a.y+-.0170491*a.z,z:-.0092345*a.x+.0150436*a.y+.7521316*a.z,a:a.a}}({x:100*(.4124564*i+.3575761*e+.1804375*h),y:100*(.2126729*i+.7151522*e+.072175*h),z:100*(.0193339*i+.119192*e+.9503041*h),a:n.a}))},h=216/24389,l=24389/27,c=function(a){var t=e(a),n=t.x/r,i=t.y/o,c=t.z/u;return n=n>h?Math.cbrt(n):(l*n+16)/116,{l:116*(i=i>h?Math.cbrt(i):(l*i+16)/116)-16,a:500*(n-i),b:200*(i-(c=c>h?Math.cbrt(c):(l*c+16)/116)),alpha:t.a}},p=function(t,n,e){var p,b=c(t),x=c(n);return function(a){var t=(a.l+16)/116,n=a.a/500+t,e=t-a.b/200;return i({x:(Math.pow(n,3)>h?Math.pow(n,3):(116*n-16)/l)*r,y:(a.l>8?Math.pow((a.l+16)/116,3):a.l/l)*o,z:(Math.pow(e,3)>h?Math.pow(e,3):(116*e-16)/l)*u,a:a.alpha})}({l:a((p={l:b.l*(1-e)+x.l*e,a:b.a*(1-e)+x.a*e,b:b.b*(1-e)+x.b*e,alpha:b.alpha*(1-e)+x.alpha*e}).l,0,100),a:a(p.a,-128,128),b:a(p.b,-128,128),alpha:a(p.alpha)})};module.exports=function(a){a.prototype.mix=function(t,n){void 0===n&&(n=.5);var r=t instanceof a?t:new a(t),o=p(this.toRgb(),r.toRgb(),n);return new a(o)}};
var a=function(a,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),a>n?n:a>t?a:t},t=function(a){var t=a/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},n=function(a){return 255*(a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a)},r=96.422,o=100,u=82.521,e=function(t){var r,o,u={x:.9555766*(r=t).x+-.0230393*r.y+.0631636*r.z,y:-.0282895*r.x+1.0099416*r.y+.0210077*r.z,z:.0122982*r.x+-.020483*r.y+1.3299098*r.z};return o={r:n(.032404542*u.x-.015371385*u.y-.004985314*u.z),g:n(-.00969266*u.x+.018760108*u.y+41556e-8*u.z),b:n(556434e-9*u.x-.002040259*u.y+.010572252*u.z),a:t.a},{r:a(o.r,0,255),g:a(o.g,0,255),b:a(o.b,0,255),a:a(o.a)}},h=function(n){var e=t(n.r),h=t(n.g),i=t(n.b);return function(t){return{x:a(t.x,0,r),y:a(t.y,0,o),z:a(t.z,0,u),a:a(t.a)}}(function(a){return{x:1.0478112*a.x+.0228866*a.y+-.050127*a.z,y:.0295424*a.x+.9904844*a.y+-.0170491*a.z,z:-.0092345*a.x+.0150436*a.y+.7521316*a.z,a:a.a}}({x:100*(.4124564*e+.3575761*h+.1804375*i),y:100*(.2126729*e+.7151522*h+.072175*i),z:100*(.0193339*e+.119192*h+.9503041*i),a:n.a}))},i=216/24389,l=24389/27,x=function(a){var t=h(a),n=t.x/r,e=t.y/o,x=t.z/u;return n=n>i?Math.cbrt(n):(l*n+16)/116,{l:116*(e=e>i?Math.cbrt(e):(l*e+16)/116)-16,a:500*(n-e),b:200*(e-(x=x>i?Math.cbrt(x):(l*x+16)/116)),alpha:t.a}},p=function(t,n,h){var p,y=x(t),b=x(n);return function(a){var t=(a.l+16)/116,n=a.a/500+t,h=t-a.b/200;return e({x:(Math.pow(n,3)>i?Math.pow(n,3):(116*n-16)/l)*r,y:(a.l>8?Math.pow((a.l+16)/116,3):a.l/l)*o,z:(Math.pow(h,3)>i?Math.pow(h,3):(116*h-16)/l)*u,a:a.alpha})}({l:a((p={l:y.l*(1-h)+b.l*h,a:y.a*(1-h)+b.a*h,b:y.b*(1-h)+b.b*h,alpha:y.alpha*(1-h)+b.alpha*h}).l,0,100),a:a(p.a,-128,128),b:a(p.b,-128,128),alpha:a(p.alpha)})};module.exports=function(a){a.prototype.mix=function(t,n){void 0===n&&(n=.5);var r=t instanceof a?t:new a(t),o=p(this.toRgb(),r.toRgb(),n);return new a(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?r:n},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=96.422,e=100,i=82.521,y=function(r){return{x:t(r.x,0,a),y:t(r.y,0,e),z:t(r.z,0,i),a:t(r.a)}},x=function(n){var t=n.x,u=n.y,o=n.z,a=n.a,e=void 0===a?1:a;if(!r(t)||!r(u)||!r(o))return null;var i=y({x:Number(t),y:Number(u),z:Number(o),a:Number(e)});return z(i)},z=function(r){var n,u=function(r){return{x:.9555766*r.x+-.0230393*r.y+.0631636*r.z,y:-.0282895*r.x+1.0099416*r.y+.0210077*r.z,z:.0122982*r.x+-.020483*r.y+1.3299098*r.z,a:r.a}}(r),a=u.x/100,e=u.y/100,i=u.z/100;return n={r:o(3.2404542*a-1.5371385*e-.4985314*i),g:o(-.969266*a+1.8760108*e+.041556*i),b:o(.0556434*a-.2040259*e+1.0572252*i),a:u.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 function(r){return{x:n(r.x,2),y:n(r.y,2),z:n(r.z,2),a:n(r.a,2)}}((t=u((r=this.rgba).r),o=u(r.g),a=u(r.b),y({x:1.0478112*(e={x:100*(.4124564*t+.3575761*o+.1804375*a),y:100*(.2126729*t+.7151522*o+.072175*a),z:100*(.0193339*t+.119192*o+.9503041*a),a:r.a}).x+.0228866*e.y+-.050127*e.z,y:.0295424*e.x+.9904844*e.y+-.0170491*e.z,z:-.0092345*e.x+.0150436*e.y+.7521316*e.z,a:e.a})));var r,t,o,a,e},t.object.push(x)};
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+0},t=function(r,n,t){return void 0===n&&(n=0),void 0===t&&(t=1),r>t?t:r>n?r:n},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=96.422,e=100,y=82.521,i=function(r){return{x:t(r.x,0,a),y:t(r.y,0,e),z:t(r.z,0,y),a:t(r.a)}},x=function(n){var t=n.x,u=n.y,o=n.z,a=n.a,e=void 0===a?1:a;if(!r(t)||!r(u)||!r(o))return null;var y=i({x:Number(t),y:Number(u),z:Number(o),a:Number(e)});return z(y)},z=function(r){var n,u,a={x:.9555766*(n=r).x+-.0230393*n.y+.0631636*n.z,y:-.0282895*n.x+1.0099416*n.y+.0210077*n.z,z:.0122982*n.x+-.020483*n.y+1.3299098*n.z};return u={r:o(.032404542*a.x-.015371385*a.y-.004985314*a.z),g:o(-.00969266*a.x+.018760108*a.y+41556e-8*a.z),b:o(556434e-9*a.x-.002040259*a.y+.010572252*a.z),a:r.a},{r:t(u.r,0,255),g:t(u.g,0,255),b:t(u.b,0,255),a:t(u.a)}};module.exports=function(r,t){r.prototype.toXyz=function(){return function(r){return{x:n(r.x,2),y:n(r.y,2),z:n(r.z,2),a:n(r.a,2)}}((t=u((r=this.rgba).r),o=u(r.g),a=u(r.b),i({x:1.0478112*(e={x:100*(.4124564*t+.3575761*o+.1804375*a),y:100*(.2126729*t+.7151522*o+.072175*a),z:100*(.0193339*t+.119192*o+.9503041*a),a:r.a}).x+.0228866*e.y+-.050127*e.z,y:.0295424*e.x+.9904844*e.y+-.0170491*e.z,z:-.0092345*e.x+.0150436*e.y+.7521316*e.z,a:e.a})));var r,t,o,a,e},t.object.push(x)};

@@ -47,7 +47,7 @@ <div align="center">

| ----------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| <nobr><b>colord 👑</b></nobr> | <nobr><b>3,620,695</b></nobr> | [![](https://badgen.net/bundlephobia/min/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/bundlephobia/minzip/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/bundlephobia/dependency-count/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/npm/types/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) |
| color | 760,254 | [![](https://badgen.net/bundlephobia/min/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/bundlephobia/minzip/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/bundlephobia/dependency-count/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/npm/types/color?color=e6591d&label=)](https://bundlephobia.com/result?p=color) |
| tinycolor2 | 1,111,927 | [![](https://badgen.net/bundlephobia/min/tinycolor2?color=red&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/bundlephobia/minzip/tinycolor2?color=red&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/bundlephobia/dependency-count/tinycolor2?color=6ead0a&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/npm/types/tinycolor2?color=e6591d&label=)](https://bundlephobia.com/result?p=tinycolor2) |
| ac-colors | 632,656 | [![](https://badgen.net/bundlephobia/min/ac-colors?color=e6591d&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/bundlephobia/minzip/ac-colors?color=e6591d&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/bundlephobia/dependency-count/ac-colors?color=6ead0a&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/npm/types/ac-colors?color=red&label=)](https://bundlephobia.com/result?p=ac-colors) |
| chroma-js | 969,079 | [![](https://badgen.net/bundlephobia/min/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/bundlephobia/minzip/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/bundlephobia/dependency-count/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/npm/types/chroma-js?color=e6591d&label=)](https://bundlephobia.com/result?p=chroma-js) |
| <nobr><b>colord 👑</b></nobr> | <nobr><b>3,524,989</b></nobr> | [![](https://badgen.net/bundlephobia/min/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/bundlephobia/minzip/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/bundlephobia/dependency-count/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) | [![](https://badgen.net/npm/types/colord?color=6ead0a&label=)](https://bundlephobia.com/result?p=colord) |
| color | 744,263 | [![](https://badgen.net/bundlephobia/min/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/bundlephobia/minzip/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/bundlephobia/dependency-count/color?color=red&label=)](https://bundlephobia.com/result?p=color) | [![](https://badgen.net/npm/types/color?color=e6591d&label=)](https://bundlephobia.com/result?p=color) |
| tinycolor2 | 971,312 | [![](https://badgen.net/bundlephobia/min/tinycolor2?color=red&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/bundlephobia/minzip/tinycolor2?color=red&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/bundlephobia/dependency-count/tinycolor2?color=6ead0a&label=)](https://bundlephobia.com/result?p=tinycolor2) | [![](https://badgen.net/npm/types/tinycolor2?color=e6591d&label=)](https://bundlephobia.com/result?p=tinycolor2) |
| ac-colors | 660,722 | [![](https://badgen.net/bundlephobia/min/ac-colors?color=e6591d&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/bundlephobia/minzip/ac-colors?color=e6591d&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/bundlephobia/dependency-count/ac-colors?color=6ead0a&label=)](https://bundlephobia.com/result?p=ac-colors) | [![](https://badgen.net/npm/types/ac-colors?color=red&label=)](https://bundlephobia.com/result?p=ac-colors) |
| chroma-js | 962,967 | [![](https://badgen.net/bundlephobia/min/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/bundlephobia/minzip/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/bundlephobia/dependency-count/chroma-js?color=red&label=)](https://bundlephobia.com/result?p=chroma-js) | [![](https://badgen.net/npm/types/chroma-js?color=e6591d&label=)](https://bundlephobia.com/result?p=chroma-js) |

@@ -69,3 +69,3 @@ The performance results were generated on a MBP 2019, 2,6 GHz Intel Core i7 by running `npm run benchmark` in the library folder. See [tests/benchmark.ts](https://github.com/omgovich/colord/blob/master/tests/benchmark.ts).

colord("rgb(192, 192, 192)").isLight(); // true
colord("hsl(0, 50%, 50%)").darken(0.25).toHex(); // "#602020"
colord("hsl(0deg, 50%, 50%)").darken(0.25).toHex(); // "#602020"
```

@@ -118,3 +118,3 @@

colord("__rGbA 10 20,, 999...").toRgbString(); // "rgb(10, 20, 255)"
colord(" hsL( 10, 200% 30 .5!!!").toHslString(); // "hsla(10, 100%, 30%, 0.5)"
colord(" hsL( -10, 200% 30 .5!!!").toHslString(); // "hsla(350, 100%, 30%, 0.5)"
colord({ r: NaN, g: -Infinity, b: +Infinity, a: 100500 }).toRgb(); // { r: 0, g: 0, b: 255, a: 1 }

@@ -608,3 +608,3 @@ ```

<details>
<summary><b><code>lch</code> (CIE LCH color space)</b> <i>1.2 KB</i></summary>
<summary><b><code>lch</code> (CIE LCH color space)</b> <i>1.3 KB</i></summary>

@@ -611,0 +611,0 @@ Adds support of [CIE LCH](https://lea.verou.me/2020/04/lch-colors-in-css-what-why-and-how/) color space. The conversion logic is ported from [CSS Color Module Level 4 Specification](https://www.w3.org/TR/css-color-4/#color-conversion-code).

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc