Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

colormangle

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colormangle - npm Package Compare versions

Comparing version 0.1.92 to 0.1.93

2

colormangle.min.js

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

"use strict";function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _createForOfIteratorHelper(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var a=0,o=function(){};return{s:o,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i=!0,l=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,n=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw n}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}var ColorMangle=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#4848db";_classCallCheck(this,e),this.colorName={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var r=this._colorType(t);this.type=r.type,this.color=r.color}return _createClass(e,[{key:"_colorType",value:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(!r)throw"invalid color";if("object"===_typeof(r)&&r.string&&(r=r.string),"string"!=typeof r)throw"invalid color";if((r=r.toLowerCase())===this.color)return{type:this.type,color:this.color};if(this.colorName[r])return{type:"hex",color:this.colorName[r]};if(e=r.match(/^(rgba?|rgb?|hsla?|#)/g),Array.isArray(e)){if("#"===e[0]){if(4===r.length&&(r=r[0]+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]),!/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r))throw"invalid hex";t="hex"}else")"===r[r.length-1]&&(t=e[0]);return{type:t,color:r}}}catch(e){if(a)throw e+":"+r}return{}}},{key:"_extractDigit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=this._colorType(e),r=t.type,a=void 0===r?this.type:r,o=t.color,n=void 0===o?this.color:o;"hex"===a&&(n=this.rgba(1,n).string);var i,l=[],s=_createForOfIteratorHelper(n.match(/\d+(\.\d+)?/g));try{for(s.s();!(i=s.n()).done;){var c=i.value;l.push(parseFloat(c))}}catch(e){s.e(e)}finally{s.f()}return l.length<4&&l.push(1),l}},{key:"getAlpha",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=this._extractDigit(e);return t&&t[3]||1}},{key:"colorScheme",value:function(){var e,t,r=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={text:{black:.88,white:1},soft:{black:.66,white:.88},placeholder:{black:.44,white:.55},transparent:{black:.22,white:.33},shade:{black:.066,white:.11},shadow:{black:.033,white:.066}},i={"--background":o?"#121212":"#f7f7f7","--content":o?"#2b2b2b":"#ffffff","--toolbar":o?"#2b2b2b":"#ffffff"},l=this.isHighLuminance(i["--content"]),s=function(){if(a&&"object"===_typeof(a)){if(a["--button"])return e=a["--button"];var n,s=_createForOfIteratorHelper(a);try{for(s.s();!(n=s.n()).done;){var c=n.value;if(c.includes("focus"))return e=a[c]}}catch(e){s.e(e)}finally{s.f()}}return e=a,t=r.matchLuminance(a,i["--content"],l?1.5:4.5),o?t:a}(),c=1,f=function(){var t=r.analogous(e,30),a=r.hsla(1,e).h,o=r.hsla(1,t[0]).h,n=r.hsla(1,t[1]).h;return a+30>360&&(o+=360),a-30<0&&(n=360-n),Math.abs(a-o)>Math.abs(a-n)?(c=-1,t[1]):t[0]}(),h=this.matchLuminance(this.complementary(s,60*c),i["--background"],3.1),u={"--shadow":"rgba(0, 0, 0, 0.033)","--shade":"rgba(0, 0, 0, 0.066)","--transparent":"rgba(0, 0, 0, 0.22)","--placeholder":"rgba(0, 0, 0, 0.33)"},d=o?this.matchLuminance(f,i["--background"],4.5):f,g=this.matchLuminance(f,i["--background"],4.5);for(var b in i)i[b+"-text"]=this.textColor(n.text,i[b]),i[b+"-focus"]=b.includes("--background")?d:s,i[b+"-focus-nude"]=b.includes("--background")?g:this.matchLuminance(o?s:t,i[b],1.66),i[b+"-focus-text"]=this.textColor(1,b.includes("--background")?d:s);for(var y in i["--focus"]=e,i["--focus-text"]=this.textColor(1,e),i["--saturate"]=t,i["--saturate-text"]=this.textColor(1,t),Object.assign(i,{"--complementary":h,"--complementary-text":this.textColor(1,h),"--analogous":f,"--analogous-text":this.textColor(1,f),"--alert":"tomato","--alert-text":"white","--success":"seagreen","--success-text":"white","--button":s,"--button-nude":o?this.matchLuminance(t,i["--content"],7):this.contrastRatio(i["--content"],t)<4.5?"inherit":t,"--button-text":this.textColor(1,s)}),i)if(i[y]&&"inherit"!==i[y])for(var v=this.isHighLuminance(i[y]),p=0,m=["soft","placeholder","transparent","shadow","shade"];p<m.length;p++){var k=m[p];i[y+"_"+k]=this.rgba(n[k][v?"white":"black"],i[y]).string}if(a&&"object"===_typeof(a)){var w,_=_createForOfIteratorHelper(a);try{for(_.s();!(w=_.n()).done;){var x=w.value;if("-"!==x[0])throw"invalid color scheme"}}catch(e){_.e(e)}finally{_.f()}Object.assign(i,a)}var j=Object.assign(i,u);return Object.keys(j).sort().reduce((function(e,t){return e[t]=j[t],e}),{})}},{key:"matchLuminance",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,n=this._colorType(t),i=n.color,l=this._colorType(e).color;if(r){var s=l,c=this.contrastRatio(s,i);if(c<r)for(var f=a||this.isHighLuminance(i)?-1:1,h=100;c<r&&h--;){var u=void 0;switch(o){case"brightness":u=this.adjustBrightness(1*f,s);break;case"luminance":u=this.adjustLuminance(1*f,s);break;default:u=this.adjustBrightness(1*f,{legacy:!0,color:s})}if(s===u)break;s=u,c=this.contrastRatio(s,i)}return this.hex(s)}var d=this._luminance(i),g=this._luminance(l);if(Math.abs(g-d)<.01)return l;for(var b=this.hex(l),y=function(e,t){return e<t?1:-1},v=y(g,d);Math.abs(g-d)>.01&&v===y(g,d);){var p=void 0;switch(o){case"saturation":p=this.adjustBrightness(v,{color:b,legacy:!0});break;case"luminance":p=this.adjustLuminance(v,b);break;default:p=this.adjustBrightness(v,b)}var m=this._luminance(p);if(m===g||v!==y(m,d))break;g=m,b=p}return this.hex(b)}},{key:"analogous",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=this._colorType(e),a=r.color,o=function(e,t){var r=e+t;return r<0?360+r:r>360?r-360:r},n=this.hsla(this.getAlpha(a),a),i="hsla("+o(n.h,t)+", "+n.s+"%, "+n.l+"%, "+n.a+")",l="hsla("+o(n.h,-t)+", "+n.s+"%, "+n.l+"%, "+n.a+")";return[this.matchLuminance(i,a),this.matchLuminance(l,a)]}},{key:"complementary",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this._colorType(e),a=r.color,o=this.hsla(this.getAlpha(a),a);return o.h<180?o.h+=180:o.h-=180,o.h+=t,o.h=o.h>360?o.h-360:o.h<0?360-o.h:o.h,this.hex(this._toString(o))}},{key:"isHighLuminance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.rgba(1,this._colorType(e).color),a=r.r,o=r.g,n=r.b,i=t?(235*a+733.75*o+114*n)/1e3:(299*a+587*o+114*n)/1e3;return i>=(t?188:128)}},{key:"_luminance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=this.rgba(1,e),r=[t.r,t.g,t.b].map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}));return.2126*r[0]+.7152*r[1]+.0722*r[2]}},{key:"_toString",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return"number"==typeof e?e:t};if("string"==typeof e)return e;if(e.hasOwnProperty("h"))return"hsla("+(e.h||0)+", "+t(e.s)+"%, "+t(e.l)+"%, "+t(e.a,1)+")";if(e.hasOwnProperty("r"))return"rgba("+t(e.r)+", "+t(e.g)+", "+t(e.b)+", "+t(e.a,1)+")";throw e}},{key:"contrastRatio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._luminance(t)+.05,a=this._luminance(e)+.05;return r>a?r/a:a/r}},{key:"textColor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color;"string"==typeof t&&(t={color:t});var r,a,o=t,n=o.color,i=void 0===n?this.color:n,l=o.fineTuned,s=void 0===l||l;if(i=this._colorType(i).color,this.getAlpha(i)<.5)return"inherit";if("number"==typeof e&&e<1)r=e,a=e;else if(e&&"object"===_typeof(e))for(var c=0,f=["black","white"];c<f.length;c++){var h=f[c],u=e[h];"number"==typeof u&&u<1&&("black"===h?r=u:"white"===h&&(a=u))}var d=function(e){return"number"==typeof e?e<1&&e>0?e:e>1?1:0:1};return this.isHighLuminance(i,s)?r?"rgba(0, 0, 0, ".concat(d(r),")"):"black":a?"rgba(255, 255, 255, ".concat(d(a),")"):"white"}},{key:"hsla",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._colorType(t),a=r.type,o=void 0===a?this.type:a,n=r.color,i=void 0===n?this.color:n,l=function(e,t,r){e/=255,t/=255,r/=255;var a=Math.min(e,t,r),o=Math.max(e,t,r),n=o-a,i=0,l=0;return i=0===n?0:o===e?(t-r)/n%6:o===t?(r-e)/n+2:(e-t)/n+4,(i=Math.round(60*i))<0&&(i+=360),l=(o+a)/2,{h:i,s:+(100*(0===n?0:n/(1-Math.abs(2*l-1)))).toFixed(1),l:l=+(100*l).toFixed(1)}};if("hex"===o){e="number"==typeof e?e:1;var s=this.rgba(e,i),c=s.r,f=s.g,h=s.b,u=s.a,d=l(c,f,h),g=d.h,b=d.s,y=d.l;return{r:c,g:f,b:h,a:u,h:g,s:b,l:y,string:this._toString({h:g,s:b,l:y,a:e})}}var v=this._extractDigit(i);if(e="number"==typeof e?e:v[3]||1,o.includes("hsl")){var p=this.rgba(e,i),m=p.r,k=p.g,w=p.b,_=p.a;return{r:m,g:k,b:w,a:_,h:v[0],s:v[1],l:v[2],string:this._toString({h:v[0],s:v[1],l:v[2],a:_})}}if(o.includes("rgb")){var x={r:v[0],g:v[1],b:v[2],a:e},j=l(x.r,x.g,x.b),O=j.h,S=j.s,T=j.l;return Object.assign(x,{r:x.r,g:x.g,b:x.b,h:O,s:S,l:T,a:x.a,string:this._toString({h:O,s:S,l:T,a:x.a})})}}},{key:"hex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=this._colorType(e),r=t.type,a=void 0===r?this.type:r,o=t.color,n=void 0===o?this.color:o;if(a.includes("rgb")||a.includes("hsl")){var i=this.rgba(1,n);return"#"+((1<<24)+(i.r<<16)+(i.g<<8)+i.b).toString(16).slice(1)}return n}},{key:"rgba",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._colorType(t),a=r.type,o=void 0===a?this.type:a,n=r.color,i=void 0===n?this.color:n;if("hex"===o){var l=i,s={r:null,g:null,b:null},c=l.match(/[a-fA-F0-9]{2}/g);4===l.length&&(c=(c=l.match(/[a-fA-F0-9]{1}/g)).map((function(e){return""+e+e})));var f=0;for(var h in s)s[h]=parseInt(c[f],16),f++;var u="number"==typeof e?e:1,d=s.r,g=s.g,b=s.b;return _objectSpread(_objectSpread({},s),{},{a:u,string:this._toString({r:+d,g:+g,b:+b,a:u})})}var y=this._extractDigit(i),v="number"==typeof e?e:y[3]||1;if(o.includes("rgb")){var p={r:y[0],g:y[1],b:y[2],a:v};return Object.assign({string:this._toString(p)},p)}if(o.includes("hsl")){var m=y[0],k=y[1],w=y[2];k/=100,w/=100;var _=(1-Math.abs(2*w-1))*k,x=_*(1-Math.abs(m/60%2-1)),j=w-_/2,O=0,S=0,T=0;return 0<=m&&m<60?(O=_,S=x,T=0):60<=m&&m<120?(O=x,S=_,T=0):120<=m&&m<180?(O=0,S=_,T=x):180<=m&&m<240?(O=0,S=x,T=_):240<=m&&m<300?(O=x,S=0,T=_):300<=m&&m<360&&(O=_,S=0,T=x),{r:O=Math.round(255*(O+j)),g:S=Math.round(255*(S+j)),b:T=Math.round(255*(T+j)),a:v,string:this._toString({r:O,g:S,b:T,a:v})}}}},{key:"adjustBrightness",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,a=!1;if("string"==typeof r?e=r||this.color:(e=r.color||this.color,a=r.legacy||!1),a){var o=this._colorType(e),n=o.color,i=this.hsla(this.getAlpha(n),n),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return e>t?t:e<0?0:e};return i.s+=(t>0?100-i.s:i.s)/100*t,i.s=l(i.s),i.l+=(t>0?100-i.l:i.l)/100*t,i.l=l(i.l),this._toString(i)}var s=this._colorType(e),c=s.type,f=void 0===c?this.type:c,h=s.color,u=void 0===h?this.color:h;if(0===t)return u;var d="hex"===f?1:this._extractDigit(u)[3]||1,g=this.rgba(d,u),b={r:0-g.r,g:0-g.g,b:0-g.b};t>0&&Object.keys(b).map((function(e){b[e]=255-g[e]})),["r","g","b"].map((function(e){g[e]+=parseInt(b[e]/100*Math.abs(t))}));var y="rgb("+g.r+", "+g.g+", "+g.b+")";return"hex"===f?this.hex(y):f.includes("rgb")?this.rgba(g.a,y).string:f.includes("hsl")?this.hsla(g.a,y).string:void 0}},{key:"adjustLuminance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._colorType(t),a=r.color,o=this.hsla(this.getAlpha(a),a),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return e>t?t:e<0?0:e};return o.l+=(e>0?100-o.l:o.l)/100*e,o.l=n(o.l),this._toString(o)}},{key:"adjustSaturation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._colorType(t),a=r.color,o=this.hsla(this.getAlpha(a),a),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return e>t?t:e<0?0:e};return o.s+=(e>0?100-o.s:o.s)/100*e,o.s=n(o.s),this._toString(o)}}]),e}();module.exports={ColorMangle:ColorMangle};
"use strict";function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _createForOfIteratorHelper(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var a=0,o=function(){};return{s:o,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i=!0,l=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){l=!0,n=e},f:function(){try{i||null==r.return||r.return()}finally{if(l)throw n}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}var ColorMangle=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#4848db";_classCallCheck(this,e),this.colorName={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var r=this._colorType(t);this.type=r.type,this.color=r.color}return _createClass(e,[{key:"_colorType",value:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(!r)throw"invalid color";if("object"===_typeof(r)&&r.string&&(r=r.string),"string"!=typeof r)throw"invalid color";if((r=r.toLowerCase())===this.color)return{type:this.type,color:this.color};if(this.colorName[r])return{type:"hex",color:this.colorName[r]};if(e=r.match(/^(rgba?|rgb?|hsla?|#)/g),Array.isArray(e)){if("#"===e[0]){if(4===r.length&&(r=r[0]+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]),!/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r))throw"invalid hex";t="hex"}else")"===r[r.length-1]&&(t=e[0]);return{type:t,color:r}}}catch(e){if(a)throw e+":"+r}return{}}},{key:"_extractDigit",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=this._colorType(e),r=t.type,a=void 0===r?this.type:r,o=t.color,n=void 0===o?this.color:o;"hex"===a&&(n=this.rgba(1,n).string);var i,l=[],s=_createForOfIteratorHelper(n.match(/\d+(\.\d+)?/g));try{for(s.s();!(i=s.n()).done;){var c=i.value;l.push(parseFloat(c))}}catch(e){s.e(e)}finally{s.f()}return l.length<4&&l.push(1),l}},{key:"getAlpha",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=this._extractDigit(e);return t&&t[3]||1}},{key:"colorScheme",value:function(){var e,t,r=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={text:{black:.88,white:1},soft:{black:.66,white:.88},placeholder:{black:.44,white:.55},transparent:{black:.22,white:.33},shade:{black:.066,white:.11},shadow:{black:.033,white:.066}},i={"--background":o?"#121212":"#f7f7f7","--content":o?"#2b2b2b":"#ffffff","--toolbar":o?"#2b2b2b":"#ffffff"},l=this.isHighLuminance(i["--content"]),s=function(){if(a&&"object"===_typeof(a)){if(a["--button"])return e=a["--button"];var n,s=_createForOfIteratorHelper(a);try{for(s.s();!(n=s.n()).done;){var c=n.value;if(c.includes("focus"))return e=a[c]}}catch(e){s.e(e)}finally{s.f()}}return e=a,t=r.matchLuminance(a,i["--content"],l?1.5:4.5),o?t:a}(),c=1,f=function(){var t=r.analogous(e,30),a=r.hsla(1,e).h,o=r.hsla(1,t[0]).h,n=r.hsla(1,t[1]).h;return a+30>360&&(o+=360),a-30<0&&(n=360-n),Math.abs(a-o)>Math.abs(a-n)?(c=-1,t[1]):t[0]}(),h=this.matchLuminance(this.complementary(s,60*c),i["--background"],3.1),u={"--shadow":"rgba(0, 0, 0, 0.033)","--shade":"rgba(0, 0, 0, 0.066)","--transparent":"rgba(0, 0, 0, 0.22)","--placeholder":"rgba(0, 0, 0, 0.33)"},d=o?this.matchLuminance(f,i["--background"],4.5):f,g=this.matchLuminance(f,i["--background"],4.5);for(var b in i)i[b+"-text"]=this.textColor(n.text,i[b]),i[b+"-focus"]=b.includes("--background")?d:s,i[b+"-focus-nude"]=b.includes("--background")?g:this.matchLuminance(o?s:t,i[b],1.66),i[b+"-focus-text"]=this.textColor(1,b.includes("--background")?d:s);for(var y in i["--focus"]=e,i["--focus-text"]=this.textColor(1,e),i["--saturate"]=t,i["--saturate-text"]=this.textColor(1,t),Object.assign(i,{"--complementary":h,"--complementary-text":this.textColor(1,h),"--analogous":f,"--analogous-text":this.textColor(1,f),"--alert":"tomato","--alert-text":"white","--success":"seagreen","--success-text":"white","--button":s,"--button-nude":o?this.matchLuminance(t,i["--content"],7):this.contrastRatio(i["--content"],t)<4.5?'"inherit"':t,"--button-text":this.textColor(1,s)}),i)if(i[y]&&'"inherit"'!==i[y])for(var v=this.isHighLuminance(i[y]),p=0,m=["soft","placeholder","transparent","shadow","shade"];p<m.length;p++){var k=m[p];i[y+"_"+k]=this.rgba(n[k][v?"white":"black"],i[y]).string}if(a&&"object"===_typeof(a)){var w,_=_createForOfIteratorHelper(a);try{for(_.s();!(w=_.n()).done;){var x=w.value;if("-"!==x[0])throw"invalid color scheme"}}catch(e){_.e(e)}finally{_.f()}Object.assign(i,a)}var j=Object.assign(i,u);return Object.keys(j).sort().reduce((function(e,t){return e[t]=j[t],e}),{})}},{key:"matchLuminance",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,n=this._colorType(t),i=n.color,l=this._colorType(e).color;if(r){var s=l,c=this.contrastRatio(s,i);if(c<r)for(var f=a||this.isHighLuminance(i)?-1:1,h=100;c<r&&h--;){var u=void 0;switch(o){case"brightness":u=this.adjustBrightness(1*f,s);break;case"luminance":u=this.adjustLuminance(1*f,s);break;default:u=this.adjustBrightness(1*f,{legacy:!0,color:s})}if(s===u)break;s=u,c=this.contrastRatio(s,i)}return this.hex(s)}var d=this._luminance(i),g=this._luminance(l);if(Math.abs(g-d)<.01)return l;for(var b=this.hex(l),y=function(e,t){return e<t?1:-1},v=y(g,d);Math.abs(g-d)>.01&&v===y(g,d);){var p=void 0;switch(o){case"saturation":p=this.adjustBrightness(v,{color:b,legacy:!0});break;case"luminance":p=this.adjustLuminance(v,b);break;default:p=this.adjustBrightness(v,b)}var m=this._luminance(p);if(m===g||v!==y(m,d))break;g=m,b=p}return this.hex(b)}},{key:"analogous",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=this._colorType(e),a=r.color,o=function(e,t){var r=e+t;return r<0?360+r:r>360?r-360:r},n=this.hsla(this.getAlpha(a),a),i="hsla("+o(n.h,t)+", "+n.s+"%, "+n.l+"%, "+n.a+")",l="hsla("+o(n.h,-t)+", "+n.s+"%, "+n.l+"%, "+n.a+")";return[this.matchLuminance(i,a),this.matchLuminance(l,a)]}},{key:"complementary",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this._colorType(e),a=r.color,o=this.hsla(this.getAlpha(a),a);return o.h<180?o.h+=180:o.h-=180,o.h+=t,o.h=o.h>360?o.h-360:o.h<0?360-o.h:o.h,this.hex(this._toString(o))}},{key:"isHighLuminance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.rgba(1,this._colorType(e).color),a=r.r,o=r.g,n=r.b,i=t?(235*a+733.75*o+114*n)/1e3:(299*a+587*o+114*n)/1e3;return i>=(t?188:128)}},{key:"_luminance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=this.rgba(1,e),r=[t.r,t.g,t.b].map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}));return.2126*r[0]+.7152*r[1]+.0722*r[2]}},{key:"_toString",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return"number"==typeof e?e:t};if("string"==typeof e)return e;if(e.hasOwnProperty("h"))return"hsla("+(e.h||0)+", "+t(e.s)+"%, "+t(e.l)+"%, "+t(e.a,1)+")";if(e.hasOwnProperty("r"))return"rgba("+t(e.r)+", "+t(e.g)+", "+t(e.b)+", "+t(e.a,1)+")";throw e}},{key:"contrastRatio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._luminance(t)+.05,a=this._luminance(e)+.05;return r>a?r/a:a/r}},{key:"textColor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color;"string"==typeof t&&(t={color:t});var r,a,o=t,n=o.color,i=void 0===n?this.color:n,l=o.fineTuned,s=void 0===l||l;if(i=this._colorType(i).color,this.getAlpha(i)<.5)return'"inherit"';if("number"==typeof e&&e<1)r=e,a=e;else if(e&&"object"===_typeof(e))for(var c=0,f=["black","white"];c<f.length;c++){var h=f[c],u=e[h];"number"==typeof u&&u<1&&("black"===h?r=u:"white"===h&&(a=u))}var d=function(e){return"number"==typeof e?e<1&&e>0?e:e>1?1:0:1};return this.isHighLuminance(i,s)?r?"rgba(0, 0, 0, ".concat(d(r),")"):"black":a?"rgba(255, 255, 255, ".concat(d(a),")"):"white"}},{key:"hsla",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._colorType(t),a=r.type,o=void 0===a?this.type:a,n=r.color,i=void 0===n?this.color:n,l=function(e,t,r){e/=255,t/=255,r/=255;var a=Math.min(e,t,r),o=Math.max(e,t,r),n=o-a,i=0,l=0;return i=0===n?0:o===e?(t-r)/n%6:o===t?(r-e)/n+2:(e-t)/n+4,(i=Math.round(60*i))<0&&(i+=360),l=(o+a)/2,{h:i,s:+(100*(0===n?0:n/(1-Math.abs(2*l-1)))).toFixed(1),l:l=+(100*l).toFixed(1)}};if("hex"===o){e="number"==typeof e?e:1;var s=this.rgba(e,i),c=s.r,f=s.g,h=s.b,u=s.a,d=l(c,f,h),g=d.h,b=d.s,y=d.l;return{r:c,g:f,b:h,a:u,h:g,s:b,l:y,string:this._toString({h:g,s:b,l:y,a:e})}}var v=this._extractDigit(i);if(e="number"==typeof e?e:v[3]||1,o.includes("hsl")){var p=this.rgba(e,i),m=p.r,k=p.g,w=p.b,_=p.a;return{r:m,g:k,b:w,a:_,h:v[0],s:v[1],l:v[2],string:this._toString({h:v[0],s:v[1],l:v[2],a:_})}}if(o.includes("rgb")){var x={r:v[0],g:v[1],b:v[2],a:e},j=l(x.r,x.g,x.b),O=j.h,S=j.s,T=j.l;return Object.assign(x,{r:x.r,g:x.g,b:x.b,h:O,s:S,l:T,a:x.a,string:this._toString({h:O,s:S,l:T,a:x.a})})}}},{key:"hex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,t=this._colorType(e),r=t.type,a=void 0===r?this.type:r,o=t.color,n=void 0===o?this.color:o;if(a.includes("rgb")||a.includes("hsl")){var i=this.rgba(1,n);return"#"+((1<<24)+(i.r<<16)+(i.g<<8)+i.b).toString(16).slice(1)}return n}},{key:"rgba",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._colorType(t),a=r.type,o=void 0===a?this.type:a,n=r.color,i=void 0===n?this.color:n;if("hex"===o){var l=i,s={r:null,g:null,b:null},c=l.match(/[a-fA-F0-9]{2}/g);4===l.length&&(c=(c=l.match(/[a-fA-F0-9]{1}/g)).map((function(e){return""+e+e})));var f=0;for(var h in s)s[h]=parseInt(c[f],16),f++;var u="number"==typeof e?e:1,d=s.r,g=s.g,b=s.b;return _objectSpread(_objectSpread({},s),{},{a:u,string:this._toString({r:+d,g:+g,b:+b,a:u})})}var y=this._extractDigit(i),v="number"==typeof e?e:y[3]||1;if(o.includes("rgb")){var p={r:y[0],g:y[1],b:y[2],a:v};return Object.assign({string:this._toString(p)},p)}if(o.includes("hsl")){var m=y[0],k=y[1],w=y[2];k/=100,w/=100;var _=(1-Math.abs(2*w-1))*k,x=_*(1-Math.abs(m/60%2-1)),j=w-_/2,O=0,S=0,T=0;return 0<=m&&m<60?(O=_,S=x,T=0):60<=m&&m<120?(O=x,S=_,T=0):120<=m&&m<180?(O=0,S=_,T=x):180<=m&&m<240?(O=0,S=x,T=_):240<=m&&m<300?(O=x,S=0,T=_):300<=m&&m<360&&(O=_,S=0,T=x),{r:O=Math.round(255*(O+j)),g:S=Math.round(255*(S+j)),b:T=Math.round(255*(T+j)),a:v,string:this._toString({r:O,g:S,b:T,a:v})}}}},{key:"adjustBrightness",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,a=!1;if("string"==typeof r?e=r||this.color:(e=r.color||this.color,a=r.legacy||!1),a){var o=this._colorType(e),n=o.color,i=this.hsla(this.getAlpha(n),n),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return e>t?t:e<0?0:e};return i.s+=(t>0?100-i.s:i.s)/100*t,i.s=l(i.s),i.l+=(t>0?100-i.l:i.l)/100*t,i.l=l(i.l),this._toString(i)}var s=this._colorType(e),c=s.type,f=void 0===c?this.type:c,h=s.color,u=void 0===h?this.color:h;if(0===t)return u;var d="hex"===f?1:this._extractDigit(u)[3]||1,g=this.rgba(d,u),b={r:0-g.r,g:0-g.g,b:0-g.b};t>0&&Object.keys(b).map((function(e){b[e]=255-g[e]})),["r","g","b"].map((function(e){g[e]+=parseInt(b[e]/100*Math.abs(t))}));var y="rgb("+g.r+", "+g.g+", "+g.b+")";return"hex"===f?this.hex(y):f.includes("rgb")?this.rgba(g.a,y).string:f.includes("hsl")?this.hsla(g.a,y).string:void 0}},{key:"adjustLuminance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._colorType(t),a=r.color,o=this.hsla(this.getAlpha(a),a),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return e>t?t:e<0?0:e};return o.l+=(e>0?100-o.l:o.l)/100*e,o.l=n(o.l),this._toString(o)}},{key:"adjustSaturation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.color,r=this._colorType(t),a=r.color,o=this.hsla(this.getAlpha(a),a),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return e>t?t:e<0?0:e};return o.s+=(e>0?100-o.s:o.s)/100*e,o.s=n(o.s),this._toString(o)}}]),e}();module.exports={ColorMangle:ColorMangle};
{
"name": "colormangle",
"version": "0.1.92",
"version": "0.1.93",
"description": "converts html color strings to various format",

@@ -5,0 +5,0 @@ "main": "colormangle.min.js",

@@ -12,3 +12,3 @@ <img alt="APM" src="https://img.shields.io/apm/l/vim-mode">

```
<script src="https://broadwayinc.dev/jslib/colormangle/0.1.92/colormangle.js"></script>
<script src="https://broadwayinc.dev/jslib/colormangle/0.1.93/colormangle.js"></script>
```

@@ -15,0 +15,0 @@ And in your javascript:

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc