@ctrl/tinycolor 3.6.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # tinycolor
2
2
 
3
3
  [![npm](https://badgen.net/npm/v/@ctrl/tinycolor)](https://www.npmjs.com/package/@ctrl/tinycolor)
4
- [![CircleCI](https://badgen.net/circleci/github/scttcper/tinycolor)](https://circleci.com/gh/scttcper/tinycolor)
5
4
  [![coverage](https://badgen.net/codecov/c/github/scttcper/tinycolor)](https://codecov.io/gh/scttcper/tinycolor)
6
5
  [![bundlesize](https://badgen.net/bundlephobia/min/@ctrl/tinycolor)](https://bundlephobia.com/result?p=@ctrl/tinycolor)
7
6
 
@@ -16,6 +15,7 @@ __DEMO__: https://tinycolor.vercel.app
16
15
  * reformatted into TypeScript / es2015 and requires node >= 8
17
16
  * tree shakeable "module" export and no package `sideEffects`
18
17
  * `tinycolor` is now exported as a class called `TinyColor`
18
+ * default export removed, use `import { TinyColor } from '@ctrl/tinycolor'`
19
19
  * new `random`, an implementation of [randomColor](https://github.com/davidmerfield/randomColor/) by David Merfield that returns a TinyColor object
20
20
  * several functions moved out of the tinycolor class and are no longer `TinyColor.<function>`
21
21
  * `readability`, `fromRatio` moved out
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).tinycolor=e()}(this,(function(){"use strict";var t={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"};function e(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function r(t){return Math.min(1,Math.max(0,t))}function n(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function a(t){return t<=1?"".concat(100*Number(t),"%"):t}function o(t){return 1===t.length?"0"+t:String(t)}function i(t,r,n){t=e(t,255),r=e(r,255),n=e(n,255);var a=Math.max(t,r,n),o=Math.min(t,r,n),i=0,s=0,h=(a+o)/2;if(a===o)s=0,i=0;else{var u=a-o;switch(s=h>.5?u/(2-a-o):u/(a+o),a){case t:i=(r-n)/u+(r<n?6:0);break;case r:i=(n-t)/u+2;break;case n:i=(t-r)/u+4}i/=6}return{h:i,s:s,l:h}}function s(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*r*(e-t):r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function h(t,r,n){t=e(t,255),r=e(r,255),n=e(n,255);var a=Math.max(t,r,n),o=Math.min(t,r,n),i=0,s=a,h=a-o,u=0===a?0:h/a;if(a===o)i=0;else{switch(a){case t:i=(r-n)/h+(r<n?6:0);break;case r:i=(n-t)/h+2;break;case n:i=(t-r)/h+4}i/=6}return{h:i,s:u,v:s}}function u(t,e,r,n){var a=[o(Math.round(t).toString(16)),o(Math.round(e).toString(16)),o(Math.round(r).toString(16))];return n&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function f(t,e,r,n){return[o(c(n)),o(Math.round(t).toString(16)),o(Math.round(e).toString(16)),o(Math.round(r).toString(16))].join("")}function c(t){return Math.round(255*parseFloat(t)).toString(16)}function l(t){return d(t)/255}function d(t){return parseInt(t,16)}function g(t){var r,o,i,h={r:0,g:0,b:0},u=1,f=null,c=null,l=null,d=!1,g=!1;return"string"==typeof t&&(t=y(t)),"object"==typeof t&&(w(t.r)&&w(t.g)&&w(t.b)?(r=t.r,o=t.g,i=t.b,h={r:255*e(r,255),g:255*e(o,255),b:255*e(i,255)},d=!0,g="%"===String(t.r).substr(-1)?"prgb":"rgb"):w(t.h)&&w(t.s)&&w(t.v)?(f=a(t.s),c=a(t.v),h=function(t,r,n){t=6*e(t,360),r=e(r,100),n=e(n,100);var a=Math.floor(t),o=t-a,i=n*(1-r),s=n*(1-o*r),h=n*(1-(1-o)*r),u=a%6;return{r:255*[n,s,i,i,h,n][u],g:255*[h,n,n,s,i,i][u],b:255*[i,i,h,n,n,s][u]}}(t.h,f,c),d=!0,g="hsv"):w(t.h)&&w(t.s)&&w(t.l)&&(f=a(t.s),l=a(t.l),h=function(t,r,n){var a,o,i;if(t=e(t,360),r=e(r,100),n=e(n,100),0===r)o=n,i=n,a=n;else{var h=n<.5?n*(1+r):n+r-n*r,u=2*n-h;a=s(u,h,t+1/3),o=s(u,h,t),i=s(u,h,t-1/3)}return{r:255*a,g:255*o,b:255*i}}(t.h,f,l),d=!0,g="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(u=t.a)),u=n(u),{ok:d,format:t.format||g,r:Math.min(255,Math.max(h.r,0)),g:Math.min(255,Math.max(h.g,0)),b:Math.min(255,Math.max(h.b,0)),a:u}}var b="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),p="[\\s|\\(]+(".concat(b,")[,|\\s]+(").concat(b,")[,|\\s]+(").concat(b,")\\s*\\)?"),v="[\\s|\\(]+(".concat(b,")[,|\\s]+(").concat(b,")[,|\\s]+(").concat(b,")[,|\\s]+(").concat(b,")\\s*\\)?"),m={CSS_UNIT:new RegExp(b),rgb:new RegExp("rgb"+p),rgba:new RegExp("rgba"+v),hsl:new RegExp("hsl"+p),hsla:new RegExp("hsla"+v),hsv:new RegExp("hsv"+p),hsva:new RegExp("hsva"+v),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function y(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var r=!1;if(t[e])e=t[e],r=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=m.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=m.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=m.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=m.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=m.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=m.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=m.hex8.exec(e))?{r:d(n[1]),g:d(n[2]),b:d(n[3]),a:l(n[4]),format:r?"name":"hex8"}:(n=m.hex6.exec(e))?{r:d(n[1]),g:d(n[2]),b:d(n[3]),format:r?"name":"hex"}:(n=m.hex4.exec(e))?{r:d(n[1]+n[1]),g:d(n[2]+n[2]),b:d(n[3]+n[3]),a:l(n[4]+n[4]),format:r?"name":"hex8"}:!!(n=m.hex3.exec(e))&&{r:d(n[1]+n[1]),g:d(n[2]+n[2]),b:d(n[3]+n[3]),format:r?"name":"hex"}}function w(t){return Boolean(m.CSS_UNIT.exec(String(t)))}var M=function(){function a(t,e){var r;if(void 0===t&&(t=""),void 0===e&&(e={}),t instanceof a)return t;"number"==typeof t&&(t=function(t){return{r:t>>16,g:(65280&t)>>8,b:255&t}}(t)),this.originalInput=t;var n=g(t);this.originalInput=t,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=e.format)&&void 0!==r?r:n.format,this.gradientType=e.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}return a.prototype.isDark=function(){return this.getBrightness()<128},a.prototype.isLight=function(){return!this.isDark()},a.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},a.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,r=t.g/255,n=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},a.prototype.getAlpha=function(){return this.a},a.prototype.setAlpha=function(t){return this.a=n(t),this.roundA=Math.round(100*this.a)/100,this},a.prototype.isMonochrome=function(){return 0===this.toHsl().s},a.prototype.toHsv=function(){var t=h(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},a.prototype.toHsvString=function(){var t=h(this.r,this.g,this.b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1===this.a?"hsv(".concat(e,", ").concat(r,"%, ").concat(n,"%)"):"hsva(".concat(e,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},a.prototype.toHsl=function(){var t=i(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},a.prototype.toHslString=function(){var t=i(this.r,this.g,this.b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1===this.a?"hsl(".concat(e,", ").concat(r,"%, ").concat(n,"%)"):"hsla(".concat(e,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},a.prototype.toHex=function(t){return void 0===t&&(t=!1),u(this.r,this.g,this.b,t)},a.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},a.prototype.toHex8=function(t){return void 0===t&&(t=!1),function(t,e,r,n,a){var i=[o(Math.round(t).toString(16)),o(Math.round(e).toString(16)),o(Math.round(r).toString(16)),o(c(n))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this.r,this.g,this.b,this.a,t)},a.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},a.prototype.toHexShortString=function(t){return void 0===t&&(t=!1),1===this.a?this.toHexString(t):this.toHex8String(t)},a.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},a.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),r=Math.round(this.b);return 1===this.a?"rgb(".concat(t,", ").concat(e,", ").concat(r,")"):"rgba(".concat(t,", ").concat(e,", ").concat(r,", ").concat(this.roundA,")")},a.prototype.toPercentageRgb=function(){var t=function(t){return"".concat(Math.round(100*e(t,255)),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},a.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*e(t,255))};return 1===this.a?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},a.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+u(this.r,this.g,this.b,!1),r=0,n=Object.entries(t);r<n.length;r++){var a=n[r],o=a[0];if(e===a[1])return o}return!1},a.prototype.toString=function(t){var e=Boolean(t);t=null!=t?t:this.format;var r=!1,n=this.a<1&&this.a>=0;return e||!n||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()},a.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},a.prototype.clone=function(){return new a(this.toString())},a.prototype.lighten=function(t){void 0===t&&(t=10);var e=this.toHsl();return e.l+=t/100,e.l=r(e.l),new a(e)},a.prototype.brighten=function(t){void 0===t&&(t=10);var e=this.toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(-t/100*255))),e.g=Math.max(0,Math.min(255,e.g-Math.round(-t/100*255))),e.b=Math.max(0,Math.min(255,e.b-Math.round(-t/100*255))),new a(e)},a.prototype.darken=function(t){void 0===t&&(t=10);var e=this.toHsl();return e.l-=t/100,e.l=r(e.l),new a(e)},a.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},a.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},a.prototype.desaturate=function(t){void 0===t&&(t=10);var e=this.toHsl();return e.s-=t/100,e.s=r(e.s),new a(e)},a.prototype.saturate=function(t){void 0===t&&(t=10);var e=this.toHsl();return e.s+=t/100,e.s=r(e.s),new a(e)},a.prototype.greyscale=function(){return this.desaturate(100)},a.prototype.spin=function(t){var e=this.toHsl(),r=(e.h+t)%360;return e.h=r<0?360+r:r,new a(e)},a.prototype.mix=function(t,e){void 0===e&&(e=50);var r=this.toRgb(),n=new a(t).toRgb(),o=e/100;return new a({r:(n.r-r.r)*o+r.r,g:(n.g-r.g)*o+r.g,b:(n.b-r.b)*o+r.b,a:(n.a-r.a)*o+r.a})},a.prototype.analogous=function(t,e){void 0===t&&(t=6),void 0===e&&(e=30);var r=this.toHsl(),n=360/e,o=[this];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,o.push(new a(r));return o},a.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new a(t)},a.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var e=this.toHsv(),r=e.h,n=e.s,o=e.v,i=[],s=1/t;t--;)i.push(new a({h:r,s:n,v:o})),o=(o+s)%1;return i},a.prototype.splitcomplement=function(){var t=this.toHsl(),e=t.h;return[this,new a({h:(e+72)%360,s:t.s,l:t.l}),new a({h:(e+216)%360,s:t.s,l:t.l})]},a.prototype.onBackground=function(t){var e=this.toRgb(),r=new a(t).toRgb(),n=e.a+r.a*(1-e.a);return new a({r:(e.r*e.a+r.r*r.a*(1-e.a))/n,g:(e.g*e.a+r.g*r.a*(1-e.a))/n,b:(e.b*e.a+r.b*r.a*(1-e.a))/n,a:n})},a.prototype.triad=function(){return this.polyad(3)},a.prototype.tetrad=function(){return this.polyad(4)},a.prototype.polyad=function(t){for(var e=this.toHsl(),r=e.h,n=[this],o=360/t,i=1;i<t;i++)n.push(new a({h:(r+i*o)%360,s:e.s,l:e.l}));return n},a.prototype.equals=function(t){return this.toRgbString()===new a(t).toRgbString()},a}();function x(t){t>=334&&t<=360&&(t-=360);for(var e=0,r=S;e<r.length;e++){var n=A(r[e]);if(n.hueRange&&t>=n.hueRange[0]&&t<=n.hueRange[1])return n}throw Error("Color not found")}function k(t,e){if(void 0===e)return Math.floor(t[0]+Math.random()*(t[1]+1-t[0]));var r=t[1]||1,n=t[0]||0,a=(e=(9301*e+49297)%233280)/233280;return Math.floor(n+a*(r-n))}function A(t){var e=t.lowerBounds[0][0],r=t.lowerBounds[t.lowerBounds.length-1][0],n=t.lowerBounds[t.lowerBounds.length-1][1],a=t.lowerBounds[0][1];return{name:t.name,hueRange:t.hueRange,lowerBounds:t.lowerBounds,saturationRange:[e,r],brightnessRange:[n,a]}}var S=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function R(t,e){var r=new M(t),n=new M(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)}var H=function(t,e){return void 0===t&&(t=""),void 0===e&&(e={}),new M(t,e)};return H.TinyColor=M,H.readability=R,H.mostReadable=function t(e,r,n){void 0===n&&(n={includeFallbackColors:!1,level:"AA",size:"small"});for(var a=null,o=0,i=n.includeFallbackColors,s=n.level,h=n.size,u=0,f=r;u<f.length;u++){var c=f[u],l=R(e,c);l>o&&(o=l,a=new M(c))}return function(t,e,r){var n,a;void 0===r&&(r={level:"AA",size:"small"});var o=R(t,e);switch((null!==(n=r.level)&&void 0!==n?n:"AA")+(null!==(a=r.size)&&void 0!==a?a:"small")){case"AAsmall":case"AAAlarge":return o>=4.5;case"AAlarge":return o>=3;case"AAAsmall":return o>=7;default:return!1}}(e,a,{level:s,size:h})||!i?a:(n.includeFallbackColors=!1,t(e,["#fff","#000"],n))},H.random=function t(e){if(void 0===e&&(e={}),void 0!==e.count&&null!==e.count){var r=e.count,n=[];for(e.count=void 0;r>n.length;)e.count=null,e.seed&&(e.seed+=1),n.push(t(e));return e.count=r,n}var a=function(t,e){var r=k(function(t){var e=parseInt(t,10);if(!Number.isNaN(e)&&e<360&&e>0)return[e,e];if("string"==typeof t){var r=S.find((function(e){return e.name===t}));if(r){var n=A(r);if(n.hueRange)return n.hueRange}var a=new M(t);if(a.isValid){var o=a.toHsv().h;return[o,o]}}return[0,360]}(t),e);r<0&&(r=360+r);return r}(e.hue,e.seed),o=function(t,e){if("monochrome"===e.hue)return 0;if("random"===e.luminosity)return k([0,100],e.seed);var r=x(t).saturationRange,n=r[0],a=r[1];switch(e.luminosity){case"bright":n=55;break;case"dark":n=a-10;break;case"light":a=55}return k([n,a],e.seed)}(a,e),i=function(t,e,r){var n=function(t,e){for(var r=x(t).lowerBounds,n=0;n<r.length-1;n++){var a=r[n][0],o=r[n][1],i=r[n+1][0],s=r[n+1][1];if(e>=a&&e<=i){var h=(s-o)/(i-a);return h*e+(o-h*a)}}return 0}(t,e),a=100;switch(r.luminosity){case"dark":a=n+20;break;case"light":n=(a+n)/2;break;case"random":n=0,a=100}return k([n,a],r.seed)}(a,o,e),s={h:a,s:o,v:i};return void 0!==e.alpha&&(s.a=e.alpha),new M(s)},H.names=t,H.fromRatio=function(t,e){var r={r:a(t.r),g:a(t.g),b:a(t.b)};return void 0!==t.a&&(r.a=Number(t.a)),new M(r,e)},H.legacyRandom=function(){return new M({r:Math.random(),g:Math.random(),b:Math.random()})},H.toMsFilter=function(t,e){var r=new M(t),n="#"+f(r.r,r.g,r.b,r.a),a=n,o=r.gradientType?"GradientType = 1, ":"";if(e){var i=new M(e);a="#"+f(i.r,i.g,i.b,i.a)}return"progid:DXImageTransform.Microsoft.gradient(".concat(o,"startColorstr=").concat(n,",endColorstr=").concat(a,")")},H.inputToRGB=g,H.stringInputToObject=y,H.isValidCSSUnit=w,H}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).tinycolor=e()}(this,(function(){"use strict";const t={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"};function e(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");const r=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function r(t){return Math.min(1,Math.max(0,t))}function n(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function a(t){return Number(t)<=1?100*Number(t)+"%":t}function s(t){return 1===t.length?"0"+t:String(t)}function o(t,r,n){t=e(t,255),r=e(r,255),n=e(n,255);const a=Math.max(t,r,n),s=Math.min(t,r,n);let o=0,i=0;const h=(a+s)/2;if(a===s)i=0,o=0;else{const e=a-s;switch(i=h>.5?e/(2-a-s):e/(a+s),a){case t:o=(r-n)/e+(r<n?6:0);break;case r:o=(n-t)/e+2;break;case n:o=(t-r)/e+4}o/=6}return{h:o,s:i,l:h}}function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*r*(e-t):r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function h(t,r,n){t=e(t,255),r=e(r,255),n=e(n,255);const a=Math.max(t,r,n),s=Math.min(t,r,n);let o=0;const i=a,h=a-s,u=0===a?0:h/a;if(a===s)o=0;else{switch(a){case t:o=(r-n)/h+(r<n?6:0);break;case r:o=(n-t)/h+2;break;case n:o=(t-r)/h+4}o/=6}return{h:o,s:u,v:i}}function u(t,e,r,n){const a=[s(Math.round(t).toString(16)),s(Math.round(e).toString(16)),s(Math.round(r).toString(16))];return n&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function f(t,e,r,n){return[s(l(n)),s(Math.round(t).toString(16)),s(Math.round(e).toString(16)),s(Math.round(r).toString(16))].join("")}function l(t){return Math.round(255*parseFloat(t)).toString(16)}function c(t){return g(t)/255}function g(t){return parseInt(t,16)}function d(t){let r={r:0,g:0,b:0},s=1,o=null,h=null,u=null,f=!1,l=!1;var c,g,d;return"string"==typeof t&&(t=M(t)),"object"==typeof t&&(x(t.r)&&x(t.g)&&x(t.b)?(c=t.r,g=t.g,d=t.b,r={r:255*e(c,255),g:255*e(g,255),b:255*e(d,255)},f=!0,l="%"===String(t.r).substr(-1)?"prgb":"rgb"):x(t.h)&&x(t.s)&&x(t.v)?(o=a(t.s),h=a(t.v),r=function(t,r,n){t=6*e(t,360),r=e(r,100),n=e(n,100);const a=Math.floor(t),s=t-a,o=n*(1-r),i=n*(1-s*r),h=n*(1-(1-s)*r),u=a%6;return{r:255*[n,i,o,o,h,n][u],g:255*[h,n,n,i,o,o][u],b:255*[o,o,h,n,n,i][u]}}(t.h,o,h),f=!0,l="hsv"):x(t.h)&&x(t.s)&&x(t.l)&&(o=a(t.s),u=a(t.l),r=function(t,r,n){let a,s,o;if(t=e(t,360),r=e(r,100),n=e(n,100),0===r)s=n,o=n,a=n;else{const e=n<.5?n*(1+r):n+r-n*r,h=2*n-e;a=i(h,e,t+1/3),s=i(h,e,t),o=i(h,e,t-1/3)}return{r:255*a,g:255*s,b:255*o}}(t.h,o,u),f=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(s=t.a)),s=n(s),{ok:f,format:t.format||l,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:s}}const b="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",m=`[\\s|\\(]+(${b})[,|\\s]+(${b})[,|\\s]+(${b})\\s*\\)?`,p=`[\\s|\\(]+(${b})[,|\\s]+(${b})[,|\\s]+(${b})[,|\\s]+(${b})\\s*\\)?`,w={CSS_UNIT:new RegExp(b),rgb:new RegExp("rgb"+m),rgba:new RegExp("rgba"+p),hsl:new RegExp("hsl"+m),hsla:new RegExp("hsla"+p),hsv:new RegExp("hsv"+m),hsva:new RegExp("hsva"+p),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function M(e){if(0===(e=e.trim().toLowerCase()).length)return!1;let r=!1;if(t[e])e=t[e],r=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};let n=w.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=w.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=w.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=w.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=w.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=w.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=w.hex8.exec(e),n?{r:g(n[1]),g:g(n[2]),b:g(n[3]),a:c(n[4]),format:r?"name":"hex8"}:(n=w.hex6.exec(e),n?{r:g(n[1]),g:g(n[2]),b:g(n[3]),format:r?"name":"hex"}:(n=w.hex4.exec(e),n?{r:g(n[1]+n[1]),g:g(n[2]+n[2]),b:g(n[3]+n[3]),a:c(n[4]+n[4]),format:r?"name":"hex8"}:(n=w.hex3.exec(e),!!n&&{r:g(n[1]+n[1]),g:g(n[2]+n[2]),b:g(n[3]+n[3]),format:r?"name":"hex"})))))))))}function x(t){return Boolean(w.CSS_UNIT.exec(String(t)))}class y{constructor(t="",e={}){if(t instanceof y)return t;"number"==typeof t&&(t=function(t){return{r:t>>16,g:(65280&t)>>8,b:255&t}}(t)),this.originalInput=t;const r=d(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=e.format??r.format,this.gradientType=e.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3}getLuminance(){const t=this.toRgb();let e,r,n;const a=t.r/255,s=t.g/255,o=t.b/255;return e=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),r=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),n=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),.2126*e+.7152*r+.0722*n}getAlpha(){return this.a}setAlpha(t){return this.a=n(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return 0===t}toHsv(){const t=h(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=h(this.r,this.g,this.b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1===this.a?`hsv(${e}, ${r}%, ${n}%)`:`hsva(${e}, ${r}%, ${n}%, ${this.roundA})`}toHsl(){const t=o(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}}toHslString(){const t=o(this.r,this.g,this.b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1===this.a?`hsl(${e}, ${r}%, ${n}%)`:`hsla(${e}, ${r}%, ${n}%, ${this.roundA})`}toHex(t=!1){return u(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return function(t,e,r,n,a){const o=[s(Math.round(t).toString(16)),s(Math.round(e).toString(16)),s(Math.round(r).toString(16)),s(l(n))];return a&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return 1===this.a?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),e=Math.round(this.g),r=Math.round(this.b);return 1===this.a?`rgb(${t}, ${e}, ${r})`:`rgba(${t}, ${e}, ${r}, ${this.roundA})`}toPercentageRgb(){const t=t=>`${Math.round(100*e(t,255))}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=t=>Math.round(100*e(t,255));return 1===this.a?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toName(){if(0===this.a)return"transparent";if(this.a<1)return!1;const e="#"+u(this.r,this.g,this.b,!1);for(const[r,n]of Object.entries(t))if(e===n)return r;return!1}toString(t){const e=Boolean(t);t=t??this.format;let r=!1;const n=this.a<1&&this.a>=0;return e||!n||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new y(this.toString())}lighten(t=10){const e=this.toHsl();return e.l+=t/100,e.l=r(e.l),new y(e)}brighten(t=10){const e=this.toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(-t/100*255))),e.g=Math.max(0,Math.min(255,e.g-Math.round(-t/100*255))),e.b=Math.max(0,Math.min(255,e.b-Math.round(-t/100*255))),new y(e)}darken(t=10){const e=this.toHsl();return e.l-=t/100,e.l=r(e.l),new y(e)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const e=this.toHsl();return e.s-=t/100,e.s=r(e.s),new y(e)}saturate(t=10){const e=this.toHsl();return e.s+=t/100,e.s=r(e.s),new y(e)}greyscale(){return this.desaturate(100)}spin(t){const e=this.toHsl(),r=(e.h+t)%360;return e.h=r<0?360+r:r,new y(e)}mix(t,e=50){const r=this.toRgb(),n=new y(t).toRgb(),a=e/100,s={r:(n.r-r.r)*a+r.r,g:(n.g-r.g)*a+r.g,b:(n.b-r.b)*a+r.b,a:(n.a-r.a)*a+r.a};return new y(s)}analogous(t=6,e=30){const r=this.toHsl(),n=360/e,a=[this];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,a.push(new y(r));return a}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new y(t)}monochromatic(t=6){const e=this.toHsv(),{h:r}=e,{s:n}=e;let{v:a}=e;const s=[],o=1/t;for(;t--;)s.push(new y({h:r,s:n,v:a})),a=(a+o)%1;return s}splitcomplement(){const t=this.toHsl(),{h:e}=t;return[this,new y({h:(e+72)%360,s:t.s,l:t.l}),new y({h:(e+216)%360,s:t.s,l:t.l})]}onBackground(t){const e=this.toRgb(),r=new y(t).toRgb(),n=e.a+r.a*(1-e.a);return new y({r:(e.r*e.a+r.r*r.a*(1-e.a))/n,g:(e.g*e.a+r.g*r.a*(1-e.a))/n,b:(e.b*e.a+r.b*r.a*(1-e.a))/n,a:n})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const e=this.toHsl(),{h:r}=e,n=[this],a=360/t;for(let s=1;s<t;s++)n.push(new y({h:(r+s*a)%360,s:e.s,l:e.l}));return n}equals(t){return this.toRgbString()===new y(t).toRgbString()}}function k(t){t>=334&&t<=360&&(t-=360);for(const e of S){const r=v(e);if(r.hueRange&&t>=r.hueRange[0]&&t<=r.hueRange[1])return r}throw Error("Color not found")}function A(t,e){if(void 0===e)return Math.floor(t[0]+Math.random()*(t[1]+1-t[0]));const r=t[1]||1,n=t[0]||0,a=(e=(9301*e+49297)%233280)/233280;return Math.floor(n+a*(r-n))}function v(t){const e=t.lowerBounds[0][0],r=t.lowerBounds[t.lowerBounds.length-1][0],n=t.lowerBounds[t.lowerBounds.length-1][1],a=t.lowerBounds[0][1];return{name:t.name,hueRange:t.hueRange,lowerBounds:t.lowerBounds,saturationRange:[e,r],brightnessRange:[n,a]}}const S=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function R(t,e){const r=new y(t),n=new y(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)}const $={TinyColor:y,readability:R,mostReadable:function t(e,r,n={includeFallbackColors:!1,level:"AA",size:"small"}){let a=null,s=0;const{includeFallbackColors:o,level:i,size:h}=n;for(const t of r){const r=R(e,t);r>s&&(s=r,a=new y(t))}return function(t,e,r={level:"AA",size:"small"}){const n=R(t,e);switch((r.level??"AA")+(r.size??"small")){case"AAsmall":case"AAAlarge":return n>=4.5;case"AAlarge":return n>=3;case"AAAsmall":return n>=7;default:return!1}}(e,a,{level:i,size:h})||!o?a:(n.includeFallbackColors=!1,t(e,["#fff","#000"],n))},random:function t(e={}){if(void 0!==e.count&&null!==e.count){const r=e.count,n=[];for(e.count=void 0;r>n.length;)e.count=null,e.seed&&(e.seed+=1),n.push(t(e));return e.count=r,n}const r=function(t,e){let r=A(function(t){const e=parseInt(t,10);if(!Number.isNaN(e)&&e<360&&e>0)return[e,e];if("string"==typeof t){const e=S.find((e=>e.name===t));if(e){const t=v(e);if(t.hueRange)return t.hueRange}const r=new y(t);if(r.isValid){const t=r.toHsv().h;return[t,t]}}return[0,360]}(t),e);r<0&&(r=360+r);return r}(e.hue,e.seed),n=function(t,e){if("monochrome"===e.hue)return 0;if("random"===e.luminosity)return A([0,100],e.seed);const{saturationRange:r}=k(t);let n=r[0],a=r[1];switch(e.luminosity){case"bright":n=55;break;case"dark":n=a-10;break;case"light":a=55}return A([n,a],e.seed)}(r,e),a=function(t,e,r){let n=function(t,e){const{lowerBounds:r}=k(t);for(let t=0;t<r.length-1;t++){const n=r[t][0],a=r[t][1],s=r[t+1][0],o=r[t+1][1];if(e>=n&&e<=s){const t=(o-a)/(s-n);return t*e+(a-t*n)}}return 0}(t,e),a=100;switch(r.luminosity){case"dark":a=n+20;break;case"light":n=(a+n)/2;break;case"random":n=0,a=100}return A([n,a],r.seed)}(r,n,e),s={h:r,s:n,v:a};return void 0!==e.alpha&&(s.a=e.alpha),new y(s)},names:t,fromRatio:function(t,e){const r={r:a(t.r),g:a(t.g),b:a(t.b)};return void 0!==t.a&&(r.a=Number(t.a)),new y(r,e)},legacyRandom:function(){return new y({r:Math.random(),g:Math.random(),b:Math.random()})},toMsFilter:function(t,e){const r=new y(t),n="#"+f(r.r,r.g,r.b,r.a);let a=n;const s=r.gradientType?"GradientType = 1, ":"";if(e){const t=new y(e);a="#"+f(t.r,t.g,t.b,t.a)}return`progid:DXImageTransform.Microsoft.gradient(${s}startColorstr=${n},endColorstr=${a})`},inputToRGB:d,stringInputToObject:M,isValidCSSUnit:x};return $}));
2
2
  //# sourceMappingURL=tinycolor.umd.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tinycolor.umd.min.js","sources":["../module/css-color-names.js","../module/util.js","../module/conversion.js","../module/format-input.js","../module/index.js","../module/random.js","../module/readability.js","../module/umd_api.js","../module/from-ratio.js","../module/to-ms-filter.js"],"sourcesContent":["// https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json\n/**\n * @hidden\n */\nexport var names = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n goldenrod: '#daa520',\n gold: '#ffd700',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavenderblush: '#fff0f5',\n lavender: '#e6e6fa',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\n","/**\n * Take input from [0, n] and return it as [0, 1]\n * @hidden\n */\nexport function bound01(n, max) {\n if (isOnePointZero(n)) {\n n = '100%';\n }\n var isPercent = isPercentage(n);\n n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));\n // Automatically convert percentage into number\n if (isPercent) {\n n = parseInt(String(n * max), 10) / 100;\n }\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n // Convert into [0, 1] range if it isn't already\n if (max === 360) {\n // If n is a hue given in degrees,\n // wrap around out-of-range values into [0, 360] range\n // then convert into [0, 1].\n n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));\n }\n else {\n // If n not a hue given in degrees\n // Convert into [0, 1] range if it isn't already.\n n = (n % max) / parseFloat(String(max));\n }\n return n;\n}\n/**\n * Force a number between 0 and 1\n * @hidden\n */\nexport function clamp01(val) {\n return Math.min(1, Math.max(0, val));\n}\n/**\n * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>\n * @hidden\n */\nexport function isOnePointZero(n) {\n return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;\n}\n/**\n * Check to see if string passed in is a percentage\n * @hidden\n */\nexport function isPercentage(n) {\n return typeof n === 'string' && n.indexOf('%') !== -1;\n}\n/**\n * Return a valid alpha value [0,1] with all invalid values being set to 1\n * @hidden\n */\nexport function boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n}\n/**\n * Replace a decimal with it's percentage value\n * @hidden\n */\nexport function convertToPercentage(n) {\n if (n <= 1) {\n return \"\".concat(Number(n) * 100, \"%\");\n }\n return n;\n}\n/**\n * Force a hex value to have 2 characters\n * @hidden\n */\nexport function pad2(c) {\n return c.length === 1 ? '0' + c : String(c);\n}\n","import { bound01, pad2 } from './util.js';\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n/**\n * Handle bounds / percentage checking to conform to CSS color spec\n * <http://www.w3.org/TR/css3-color/>\n * *Assumes:* r, g, b in [0, 255] or [0, 1]\n * *Returns:* { r, g, b } in [0, 255]\n */\nexport function rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255,\n };\n}\n/**\n * Converts an RGB color value to HSL.\n * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n * *Returns:* { h, s, l } in [0,1]\n */\nexport function rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b);\n var min = Math.min(r, g, b);\n var h = 0;\n var s = 0;\n var l = (max + min) / 2;\n if (max === min) {\n s = 0;\n h = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, l: l };\n}\nfunction hue2rgb(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * (6 * t);\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n}\n/**\n * Converts an HSL color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nexport function hslToRgb(h, s, l) {\n var r;\n var g;\n var b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n if (s === 0) {\n // achromatic\n g = l;\n b = l;\n r = l;\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color value to HSV\n *\n * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n * *Returns:* { h, s, v } in [0,1]\n */\nexport function rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b);\n var min = Math.min(r, g, b);\n var h = 0;\n var v = max;\n var d = max - min;\n var s = max === 0 ? 0 : d / max;\n if (max === min) {\n h = 0; // achromatic\n }\n else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n/**\n * Converts an HSV color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nexport function hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n var i = Math.floor(h);\n var f = h - i;\n var p = v * (1 - s);\n var q = v * (1 - f * s);\n var t = v * (1 - (1 - f) * s);\n var mod = i % 6;\n var r = [v, q, p, p, t, v][mod];\n var g = [t, v, v, q, p, p][mod];\n var b = [p, p, t, v, v, q][mod];\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color to hex\n *\n * Assumes r, g, and b are contained in the set [0, 255]\n * Returns a 3 or 6 character hex\n */\nexport function rgbToHex(r, g, b, allow3Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n // Return a 3 character hex if possible\n if (allow3Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join('');\n}\n/**\n * Converts an RGBA color plus alpha transparency to hex\n *\n * Assumes r, g, b are contained in the set [0, 255] and\n * a in [0, 1]. Returns a 4 or 8 character rgba hex\n */\n// eslint-disable-next-line max-params\nexport function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n pad2(convertDecimalToHex(a)),\n ];\n // Return a 4 character hex if possible\n if (allow4Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1)) &&\n hex[3].startsWith(hex[3].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join('');\n}\n/**\n * Converts an RGBA color to an ARGB Hex8 string\n * Rarely used, but required for \"toFilter()\"\n */\nexport function rgbaToArgbHex(r, g, b, a) {\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n return hex.join('');\n}\n/** Converts a decimal to a hex value */\nexport function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n/** Converts a hex value to a decimal */\nexport function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}\n/** Parse a base-16 hex value into a base-10 integer */\nexport function parseIntFromHex(val) {\n return parseInt(val, 16);\n}\nexport function numberInputToObject(color) {\n return {\n r: color >> 16,\n g: (color & 0xff00) >> 8,\n b: color & 0xff,\n };\n}\n","/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\nimport { convertHexToDecimal, hslToRgb, hsvToRgb, parseIntFromHex, rgbToRgb, } from './conversion.js';\nimport { names } from './css-color-names.js';\nimport { boundAlpha, convertToPercentage } from './util.js';\n/**\n * Given a string or object, convert that input to RGB\n *\n * Possible string inputs:\n * ```\n * \"red\"\n * \"#f00\" or \"f00\"\n * \"#ff0000\" or \"ff0000\"\n * \"#ff000000\" or \"ff000000\"\n * \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n * \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n * \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n * \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n * \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n * \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n * \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n * ```\n */\nexport function inputToRGB(color) {\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n if (typeof color === 'string') {\n color = stringInputToObject(color);\n }\n if (typeof color === 'object') {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = 'hsv';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = 'hsl';\n }\n if (Object.prototype.hasOwnProperty.call(color, 'a')) {\n a = color.a;\n }\n }\n a = boundAlpha(a);\n return {\n ok: ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a: a,\n };\n}\n// <http://www.w3.org/TR/css3-values/#integers>\nvar CSS_INTEGER = '[-\\\\+]?\\\\d+%?';\n// <http://www.w3.org/TR/css3-values/#number-value>\nvar CSS_NUMBER = '[-\\\\+]?\\\\d*\\\\.\\\\d+%?';\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\nvar CSS_UNIT = \"(?:\".concat(CSS_NUMBER, \")|(?:\").concat(CSS_INTEGER, \")\");\n// Actual matching.\n// Parentheses and commas are optional, but not required.\n// Whitespace can take the place of commas or opening paren\nvar PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\".concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")\\\\s*\\\\)?\");\nvar PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\".concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")[,|\\\\s]+(\").concat(CSS_UNIT, \")\\\\s*\\\\)?\");\nvar matchers = {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),\n rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),\n hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),\n hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),\n hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),\n hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n};\n/**\n * Permissive string parsing. Take in a number of formats, and output an object\n * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\n */\nexport function stringInputToObject(color) {\n color = color.trim().toLowerCase();\n if (color.length === 0) {\n return false;\n }\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color === 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: 'name' };\n }\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match = matchers.rgb.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n match = matchers.rgba.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n match = matchers.hsl.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n match = matchers.hsla.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n match = matchers.hsv.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n match = matchers.hsva.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n match = matchers.hex8.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex6.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n match = matchers.hex4.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1] + match[1]),\n g: parseIntFromHex(match[2] + match[2]),\n b: parseIntFromHex(match[3] + match[3]),\n a: convertHexToDecimal(match[4] + match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex3.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1] + match[1]),\n g: parseIntFromHex(match[2] + match[2]),\n b: parseIntFromHex(match[3] + match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n return false;\n}\n/**\n * Check to see if it looks like a CSS unit\n * (see `matchers` above for definition).\n */\nexport function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}\n","import { numberInputToObject, rgbaToHex, rgbToHex, rgbToHsl, rgbToHsv } from './conversion.js';\nimport { names } from './css-color-names.js';\nimport { inputToRGB } from './format-input';\nimport { bound01, boundAlpha, clamp01 } from './util.js';\nvar TinyColor = /** @class */ (function () {\n function TinyColor(color, opts) {\n if (color === void 0) { color = ''; }\n if (opts === void 0) { opts = {}; }\n var _a;\n // If input is already a tinycolor, return itself\n if (color instanceof TinyColor) {\n // eslint-disable-next-line no-constructor-return\n return color;\n }\n if (typeof color === 'number') {\n color = numberInputToObject(color);\n }\n this.originalInput = color;\n var rgb = inputToRGB(color);\n this.originalInput = color;\n this.r = rgb.r;\n this.g = rgb.g;\n this.b = rgb.b;\n this.a = rgb.a;\n this.roundA = Math.round(100 * this.a) / 100;\n this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;\n this.gradientType = opts.gradientType;\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this.r < 1) {\n this.r = Math.round(this.r);\n }\n if (this.g < 1) {\n this.g = Math.round(this.g);\n }\n if (this.b < 1) {\n this.b = Math.round(this.b);\n }\n this.isValid = rgb.ok;\n }\n TinyColor.prototype.isDark = function () {\n return this.getBrightness() < 128;\n };\n TinyColor.prototype.isLight = function () {\n return !this.isDark();\n };\n /**\n * Returns the perceived brightness of the color, from 0-255.\n */\n TinyColor.prototype.getBrightness = function () {\n // http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n };\n /**\n * Returns the perceived luminance of a color, from 0-1.\n */\n TinyColor.prototype.getLuminance = function () {\n // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var R;\n var G;\n var B;\n var RsRGB = rgb.r / 255;\n var GsRGB = rgb.g / 255;\n var BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) {\n R = RsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n }\n if (GsRGB <= 0.03928) {\n G = GsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n }\n if (BsRGB <= 0.03928) {\n B = BsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n }\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n };\n /**\n * Returns the alpha value of a color, from 0-1.\n */\n TinyColor.prototype.getAlpha = function () {\n return this.a;\n };\n /**\n * Sets the alpha value on the current color.\n *\n * @param alpha - The new alpha value. The accepted range is 0-1.\n */\n TinyColor.prototype.setAlpha = function (alpha) {\n this.a = boundAlpha(alpha);\n this.roundA = Math.round(100 * this.a) / 100;\n return this;\n };\n /**\n * Returns whether the color is monochrome.\n */\n TinyColor.prototype.isMonochrome = function () {\n var s = this.toHsl().s;\n return s === 0;\n };\n /**\n * Returns the object as a HSVA object.\n */\n TinyColor.prototype.toHsv = function () {\n var hsv = rgbToHsv(this.r, this.g, this.b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };\n };\n /**\n * Returns the hsva values interpolated into a string with the following format:\n * \"hsva(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toHsvString = function () {\n var hsv = rgbToHsv(this.r, this.g, this.b);\n var h = Math.round(hsv.h * 360);\n var s = Math.round(hsv.s * 100);\n var v = Math.round(hsv.v * 100);\n return this.a === 1 ? \"hsv(\".concat(h, \", \").concat(s, \"%, \").concat(v, \"%)\") : \"hsva(\".concat(h, \", \").concat(s, \"%, \").concat(v, \"%, \").concat(this.roundA, \")\");\n };\n /**\n * Returns the object as a HSLA object.\n */\n TinyColor.prototype.toHsl = function () {\n var hsl = rgbToHsl(this.r, this.g, this.b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };\n };\n /**\n * Returns the hsla values interpolated into a string with the following format:\n * \"hsla(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toHslString = function () {\n var hsl = rgbToHsl(this.r, this.g, this.b);\n var h = Math.round(hsl.h * 360);\n var s = Math.round(hsl.s * 100);\n var l = Math.round(hsl.l * 100);\n return this.a === 1 ? \"hsl(\".concat(h, \", \").concat(s, \"%, \").concat(l, \"%)\") : \"hsla(\".concat(h, \", \").concat(s, \"%, \").concat(l, \"%, \").concat(this.roundA, \")\");\n };\n /**\n * Returns the hex value of the color.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n TinyColor.prototype.toHex = function (allow3Char) {\n if (allow3Char === void 0) { allow3Char = false; }\n return rgbToHex(this.r, this.g, this.b, allow3Char);\n };\n /**\n * Returns the hex value of the color -with a # prefixed.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n TinyColor.prototype.toHexString = function (allow3Char) {\n if (allow3Char === void 0) { allow3Char = false; }\n return '#' + this.toHex(allow3Char);\n };\n /**\n * Returns the hex 8 value of the color.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n TinyColor.prototype.toHex8 = function (allow4Char) {\n if (allow4Char === void 0) { allow4Char = false; }\n return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);\n };\n /**\n * Returns the hex 8 value of the color -with a # prefixed.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n TinyColor.prototype.toHex8String = function (allow4Char) {\n if (allow4Char === void 0) { allow4Char = false; }\n return '#' + this.toHex8(allow4Char);\n };\n /**\n * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.\n * @param allowShortChar will shorten hex value to 3 or 4 char if possible\n */\n TinyColor.prototype.toHexShortString = function (allowShortChar) {\n if (allowShortChar === void 0) { allowShortChar = false; }\n return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);\n };\n /**\n * Returns the object as a RGBA object.\n */\n TinyColor.prototype.toRgb = function () {\n return {\n r: Math.round(this.r),\n g: Math.round(this.g),\n b: Math.round(this.b),\n a: this.a,\n };\n };\n /**\n * Returns the RGBA values interpolated into a string with the following format:\n * \"RGBA(xxx, xxx, xxx, xx)\".\n */\n TinyColor.prototype.toRgbString = function () {\n var r = Math.round(this.r);\n var g = Math.round(this.g);\n var b = Math.round(this.b);\n return this.a === 1 ? \"rgb(\".concat(r, \", \").concat(g, \", \").concat(b, \")\") : \"rgba(\".concat(r, \", \").concat(g, \", \").concat(b, \", \").concat(this.roundA, \")\");\n };\n /**\n * Returns the object as a RGBA object.\n */\n TinyColor.prototype.toPercentageRgb = function () {\n var fmt = function (x) { return \"\".concat(Math.round(bound01(x, 255) * 100), \"%\"); };\n return {\n r: fmt(this.r),\n g: fmt(this.g),\n b: fmt(this.b),\n a: this.a,\n };\n };\n /**\n * Returns the RGBA relative values interpolated into a string\n */\n TinyColor.prototype.toPercentageRgbString = function () {\n var rnd = function (x) { return Math.round(bound01(x, 255) * 100); };\n return this.a === 1\n ? \"rgb(\".concat(rnd(this.r), \"%, \").concat(rnd(this.g), \"%, \").concat(rnd(this.b), \"%)\")\n : \"rgba(\".concat(rnd(this.r), \"%, \").concat(rnd(this.g), \"%, \").concat(rnd(this.b), \"%, \").concat(this.roundA, \")\");\n };\n /**\n * The 'real' name of the color -if there is one.\n */\n TinyColor.prototype.toName = function () {\n if (this.a === 0) {\n return 'transparent';\n }\n if (this.a < 1) {\n return false;\n }\n var hex = '#' + rgbToHex(this.r, this.g, this.b, false);\n for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n if (hex === value) {\n return key;\n }\n }\n return false;\n };\n TinyColor.prototype.toString = function (format) {\n var formatSet = Boolean(format);\n format = format !== null && format !== void 0 ? format : this.format;\n var formattedString = false;\n var hasAlpha = this.a < 1 && this.a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith('hex') || format === 'name');\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === 'name' && this.a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === 'rgb') {\n formattedString = this.toRgbString();\n }\n if (format === 'prgb') {\n formattedString = this.toPercentageRgbString();\n }\n if (format === 'hex' || format === 'hex6') {\n formattedString = this.toHexString();\n }\n if (format === 'hex3') {\n formattedString = this.toHexString(true);\n }\n if (format === 'hex4') {\n formattedString = this.toHex8String(true);\n }\n if (format === 'hex8') {\n formattedString = this.toHex8String();\n }\n if (format === 'name') {\n formattedString = this.toName();\n }\n if (format === 'hsl') {\n formattedString = this.toHslString();\n }\n if (format === 'hsv') {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n };\n TinyColor.prototype.toNumber = function () {\n return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);\n };\n TinyColor.prototype.clone = function () {\n return new TinyColor(this.toString());\n };\n /**\n * Lighten the color a given amount. Providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.lighten = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n };\n /**\n * Brighten the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.brighten = function (amount) {\n if (amount === void 0) { amount = 10; }\n var rgb = this.toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return new TinyColor(rgb);\n };\n /**\n * Darken the color a given amount, from 0 to 100.\n * Providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.darken = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n };\n /**\n * Mix the color with pure white, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.tint = function (amount) {\n if (amount === void 0) { amount = 10; }\n return this.mix('white', amount);\n };\n /**\n * Mix the color with pure black, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.shade = function (amount) {\n if (amount === void 0) { amount = 10; }\n return this.mix('black', amount);\n };\n /**\n * Desaturate the color a given amount, from 0 to 100.\n * Providing 100 will is the same as calling greyscale\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.desaturate = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n };\n /**\n * Saturate the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n TinyColor.prototype.saturate = function (amount) {\n if (amount === void 0) { amount = 10; }\n var hsl = this.toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n };\n /**\n * Completely desaturates a color into greyscale.\n * Same as calling `desaturate(100)`\n */\n TinyColor.prototype.greyscale = function () {\n return this.desaturate(100);\n };\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n TinyColor.prototype.spin = function (amount) {\n var hsl = this.toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return new TinyColor(hsl);\n };\n /**\n * Mix the current color a given amount with another color, from 0 to 100.\n * 0 means no mixing (return current color).\n */\n TinyColor.prototype.mix = function (color, amount) {\n if (amount === void 0) { amount = 50; }\n var rgb1 = this.toRgb();\n var rgb2 = new TinyColor(color).toRgb();\n var p = amount / 100;\n var rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a,\n };\n return new TinyColor(rgba);\n };\n TinyColor.prototype.analogous = function (results, slices) {\n if (results === void 0) { results = 6; }\n if (slices === void 0) { slices = 30; }\n var hsl = this.toHsl();\n var part = 360 / slices;\n var ret = [this];\n for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(new TinyColor(hsl));\n }\n return ret;\n };\n /**\n * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js\n */\n TinyColor.prototype.complement = function () {\n var hsl = this.toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return new TinyColor(hsl);\n };\n TinyColor.prototype.monochromatic = function (results) {\n if (results === void 0) { results = 6; }\n var hsv = this.toHsv();\n var h = hsv.h;\n var s = hsv.s;\n var v = hsv.v;\n var res = [];\n var modification = 1 / results;\n while (results--) {\n res.push(new TinyColor({ h: h, s: s, v: v }));\n v = (v + modification) % 1;\n }\n return res;\n };\n TinyColor.prototype.splitcomplement = function () {\n var hsl = this.toHsl();\n var h = hsl.h;\n return [\n this,\n new TinyColor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),\n new TinyColor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),\n ];\n };\n /**\n * Compute how the color would appear on a background\n */\n TinyColor.prototype.onBackground = function (background) {\n var fg = this.toRgb();\n var bg = new TinyColor(background).toRgb();\n var alpha = fg.a + bg.a * (1 - fg.a);\n return new TinyColor({\n r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,\n g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,\n b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,\n a: alpha,\n });\n };\n /**\n * Alias for `polyad(3)`\n */\n TinyColor.prototype.triad = function () {\n return this.polyad(3);\n };\n /**\n * Alias for `polyad(4)`\n */\n TinyColor.prototype.tetrad = function () {\n return this.polyad(4);\n };\n /**\n * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)\n * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...\n */\n TinyColor.prototype.polyad = function (n) {\n var hsl = this.toHsl();\n var h = hsl.h;\n var result = [this];\n var increment = 360 / n;\n for (var i = 1; i < n; i++) {\n result.push(new TinyColor({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));\n }\n return result;\n };\n /**\n * compare color vs current color\n */\n TinyColor.prototype.equals = function (color) {\n return this.toRgbString() === new TinyColor(color).toRgbString();\n };\n return TinyColor;\n}());\nexport { TinyColor };\n// kept for backwards compatability with v1\nexport function tinycolor(color, opts) {\n if (color === void 0) { color = ''; }\n if (opts === void 0) { opts = {}; }\n return new TinyColor(color, opts);\n}\n","/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n// randomColor by David Merfield under the CC0 license\n// https://github.com/davidmerfield/randomColor/\nimport { TinyColor } from './index.js';\nexport function random(options) {\n if (options === void 0) { options = {}; }\n // Check if we need to generate multiple colors\n if (options.count !== undefined &&\n options.count !== null) {\n var totalColors = options.count;\n var colors = [];\n options.count = undefined;\n while (totalColors > colors.length) {\n // Since we're generating multiple colors,\n // incremement the seed. Otherwise we'd just\n // generate the same color each time...\n options.count = null;\n if (options.seed) {\n options.seed += 1;\n }\n colors.push(random(options));\n }\n options.count = totalColors;\n return colors;\n }\n // First we pick a hue (H)\n var h = pickHue(options.hue, options.seed);\n // Then use H to determine saturation (S)\n var s = pickSaturation(h, options);\n // Then use S and H to determine brightness (B).\n var v = pickBrightness(h, s, options);\n var res = { h: h, s: s, v: v };\n if (options.alpha !== undefined) {\n res.a = options.alpha;\n }\n // Then we return the HSB color in the desired format\n return new TinyColor(res);\n}\nfunction pickHue(hue, seed) {\n var hueRange = getHueRange(hue);\n var res = randomWithin(hueRange, seed);\n // Instead of storing red as two seperate ranges,\n // we group them, using negative numbers\n if (res < 0) {\n res = 360 + res;\n }\n return res;\n}\nfunction pickSaturation(hue, options) {\n if (options.hue === 'monochrome') {\n return 0;\n }\n if (options.luminosity === 'random') {\n return randomWithin([0, 100], options.seed);\n }\n var saturationRange = getColorInfo(hue).saturationRange;\n var sMin = saturationRange[0];\n var sMax = saturationRange[1];\n switch (options.luminosity) {\n case 'bright':\n sMin = 55;\n break;\n case 'dark':\n sMin = sMax - 10;\n break;\n case 'light':\n sMax = 55;\n break;\n default:\n break;\n }\n return randomWithin([sMin, sMax], options.seed);\n}\nfunction pickBrightness(H, S, options) {\n var bMin = getMinimumBrightness(H, S);\n var bMax = 100;\n switch (options.luminosity) {\n case 'dark':\n bMax = bMin + 20;\n break;\n case 'light':\n bMin = (bMax + bMin) / 2;\n break;\n case 'random':\n bMin = 0;\n bMax = 100;\n break;\n default:\n break;\n }\n return randomWithin([bMin, bMax], options.seed);\n}\nfunction getMinimumBrightness(H, S) {\n var lowerBounds = getColorInfo(H).lowerBounds;\n for (var i = 0; i < lowerBounds.length - 1; i++) {\n var s1 = lowerBounds[i][0];\n var v1 = lowerBounds[i][1];\n var s2 = lowerBounds[i + 1][0];\n var v2 = lowerBounds[i + 1][1];\n if (S >= s1 && S <= s2) {\n var m = (v2 - v1) / (s2 - s1);\n var b = v1 - m * s1;\n return m * S + b;\n }\n }\n return 0;\n}\nfunction getHueRange(colorInput) {\n var num = parseInt(colorInput, 10);\n if (!Number.isNaN(num) && num < 360 && num > 0) {\n return [num, num];\n }\n if (typeof colorInput === 'string') {\n var namedColor = bounds.find(function (n) { return n.name === colorInput; });\n if (namedColor) {\n var color = defineColor(namedColor);\n if (color.hueRange) {\n return color.hueRange;\n }\n }\n var parsed = new TinyColor(colorInput);\n if (parsed.isValid) {\n var hue = parsed.toHsv().h;\n return [hue, hue];\n }\n }\n return [0, 360];\n}\nfunction getColorInfo(hue) {\n // Maps red colors to make picking hue easier\n if (hue >= 334 && hue <= 360) {\n hue -= 360;\n }\n for (var _i = 0, bounds_1 = bounds; _i < bounds_1.length; _i++) {\n var bound = bounds_1[_i];\n var color = defineColor(bound);\n if (color.hueRange && hue >= color.hueRange[0] && hue <= color.hueRange[1]) {\n return color;\n }\n }\n throw Error('Color not found');\n}\nfunction randomWithin(range, seed) {\n if (seed === undefined) {\n return Math.floor(range[0] + Math.random() * (range[1] + 1 - range[0]));\n }\n // Seeded random algorithm from http://indiegamr.com/generate-repeatable-random-numbers-in-js/\n var max = range[1] || 1;\n var min = range[0] || 0;\n seed = (seed * 9301 + 49297) % 233280;\n var rnd = seed / 233280.0;\n return Math.floor(min + rnd * (max - min));\n}\nfunction defineColor(bound) {\n var sMin = bound.lowerBounds[0][0];\n var sMax = bound.lowerBounds[bound.lowerBounds.length - 1][0];\n var bMin = bound.lowerBounds[bound.lowerBounds.length - 1][1];\n var bMax = bound.lowerBounds[0][1];\n return {\n name: bound.name,\n hueRange: bound.hueRange,\n lowerBounds: bound.lowerBounds,\n saturationRange: [sMin, sMax],\n brightnessRange: [bMin, bMax],\n };\n}\n/**\n * @hidden\n */\nexport var bounds = [\n {\n name: 'monochrome',\n hueRange: null,\n lowerBounds: [\n [0, 0],\n [100, 0],\n ],\n },\n {\n name: 'red',\n hueRange: [-26, 18],\n lowerBounds: [\n [20, 100],\n [30, 92],\n [40, 89],\n [50, 85],\n [60, 78],\n [70, 70],\n [80, 60],\n [90, 55],\n [100, 50],\n ],\n },\n {\n name: 'orange',\n hueRange: [19, 46],\n lowerBounds: [\n [20, 100],\n [30, 93],\n [40, 88],\n [50, 86],\n [60, 85],\n [70, 70],\n [100, 70],\n ],\n },\n {\n name: 'yellow',\n hueRange: [47, 62],\n lowerBounds: [\n [25, 100],\n [40, 94],\n [50, 89],\n [60, 86],\n [70, 84],\n [80, 82],\n [90, 80],\n [100, 75],\n ],\n },\n {\n name: 'green',\n hueRange: [63, 178],\n lowerBounds: [\n [30, 100],\n [40, 90],\n [50, 85],\n [60, 81],\n [70, 74],\n [80, 64],\n [90, 50],\n [100, 40],\n ],\n },\n {\n name: 'blue',\n hueRange: [179, 257],\n lowerBounds: [\n [20, 100],\n [30, 86],\n [40, 80],\n [50, 74],\n [60, 60],\n [70, 52],\n [80, 44],\n [90, 39],\n [100, 35],\n ],\n },\n {\n name: 'purple',\n hueRange: [258, 282],\n lowerBounds: [\n [20, 100],\n [30, 87],\n [40, 79],\n [50, 70],\n [60, 65],\n [70, 59],\n [80, 52],\n [90, 45],\n [100, 42],\n ],\n },\n {\n name: 'pink',\n hueRange: [283, 334],\n lowerBounds: [\n [20, 100],\n [30, 90],\n [40, 86],\n [60, 84],\n [80, 80],\n [90, 75],\n [100, 73],\n ],\n },\n];\n","import { TinyColor } from './index.js';\n// Readability Functions\n// ---------------------\n// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)\n/**\n * AKA `contrast`\n *\n * Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)\n */\nexport function readability(color1, color2) {\n var c1 = new TinyColor(color1);\n var c2 = new TinyColor(color2);\n return ((Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) /\n (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05));\n}\n/**\n * Ensure that foreground and background color combinations meet WCAG2 guidelines.\n * The third argument is an object.\n * the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';\n * the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.\n * If the entire object is absent, isReadable defaults to {level:\"AA\",size:\"small\"}.\n *\n * Example\n * ```ts\n * new TinyColor().isReadable('#000', '#111') => false\n * new TinyColor().isReadable('#000', '#111', { level: 'AA', size: 'large' }) => false\n * ```\n */\nexport function isReadable(color1, color2, wcag2) {\n var _a, _b;\n if (wcag2 === void 0) { wcag2 = { level: 'AA', size: 'small' }; }\n var readabilityLevel = readability(color1, color2);\n switch (((_a = wcag2.level) !== null && _a !== void 0 ? _a : 'AA') + ((_b = wcag2.size) !== null && _b !== void 0 ? _b : 'small')) {\n case 'AAsmall':\n case 'AAAlarge':\n return readabilityLevel >= 4.5;\n case 'AAlarge':\n return readabilityLevel >= 3;\n case 'AAAsmall':\n return readabilityLevel >= 7;\n default:\n return false;\n }\n}\n/**\n * Given a base color and a list of possible foreground or background\n * colors for that base, returns the most readable color.\n * Optionally returns Black or White if the most readable color is unreadable.\n *\n * @param baseColor - the base color.\n * @param colorList - array of colors to pick the most readable one from.\n * @param args - and object with extra arguments\n *\n * Example\n * ```ts\n * new TinyColor().mostReadable('#123', ['#124\", \"#125'], { includeFallbackColors: false }).toHexString(); // \"#112255\"\n * new TinyColor().mostReadable('#123', ['#124\", \"#125'],{ includeFallbackColors: true }).toHexString(); // \"#ffffff\"\n * new TinyColor().mostReadable('#a8015a', [\"#faf3f3\"], { includeFallbackColors:true, level: 'AAA', size: 'large' }).toHexString(); // \"#faf3f3\"\n * new TinyColor().mostReadable('#a8015a', [\"#faf3f3\"], { includeFallbackColors:true, level: 'AAA', size: 'small' }).toHexString(); // \"#ffffff\"\n * ```\n */\nexport function mostReadable(baseColor, colorList, args) {\n if (args === void 0) { args = { includeFallbackColors: false, level: 'AA', size: 'small' }; }\n var bestColor = null;\n var bestScore = 0;\n var includeFallbackColors = args.includeFallbackColors, level = args.level, size = args.size;\n for (var _i = 0, colorList_1 = colorList; _i < colorList_1.length; _i++) {\n var color = colorList_1[_i];\n var score = readability(baseColor, color);\n if (score > bestScore) {\n bestScore = score;\n bestColor = new TinyColor(color);\n }\n }\n if (isReadable(baseColor, bestColor, { level: level, size: size }) || !includeFallbackColors) {\n return bestColor;\n }\n args.includeFallbackColors = false;\n return mostReadable(baseColor, ['#fff', '#000'], args);\n}\n","import { names } from './css-color-names.js';\nimport { inputToRGB, isValidCSSUnit, stringInputToObject } from './format-input.js';\nimport { fromRatio, legacyRandom } from './from-ratio.js';\nimport { TinyColor, tinycolor } from './index.js';\nimport { random } from './random.js';\nimport { mostReadable, readability } from './readability.js';\nimport { toMsFilter } from './to-ms-filter.js';\nvar tinycolorumd = tinycolor;\ntinycolorumd.TinyColor = TinyColor;\ntinycolorumd.readability = readability;\ntinycolorumd.mostReadable = mostReadable;\ntinycolorumd.random = random;\ntinycolorumd.names = names;\ntinycolorumd.fromRatio = fromRatio;\ntinycolorumd.legacyRandom = legacyRandom;\ntinycolorumd.toMsFilter = toMsFilter;\ntinycolorumd.inputToRGB = inputToRGB;\ntinycolorumd.stringInputToObject = stringInputToObject;\ntinycolorumd.isValidCSSUnit = isValidCSSUnit;\nexport default tinycolorumd;\n","import { TinyColor } from './index.js';\nimport { convertToPercentage } from './util.js';\n/**\n * If input is an object, force 1 into \"1.0\" to handle ratios properly\n * String input requires \"1.0\" as input, so 1 will be treated as 1\n */\nexport function fromRatio(ratio, opts) {\n var newColor = {\n r: convertToPercentage(ratio.r),\n g: convertToPercentage(ratio.g),\n b: convertToPercentage(ratio.b),\n };\n if (ratio.a !== undefined) {\n newColor.a = Number(ratio.a);\n }\n return new TinyColor(newColor, opts);\n}\n/** old random function */\nexport function legacyRandom() {\n return new TinyColor({\n r: Math.random(),\n g: Math.random(),\n b: Math.random(),\n });\n}\n","import { rgbaToArgbHex } from './conversion.js';\nimport { TinyColor } from './index.js';\n/**\n * Returns the color represented as a Microsoft filter for use in old versions of IE.\n */\nexport function toMsFilter(firstColor, secondColor) {\n var color = new TinyColor(firstColor);\n var hex8String = '#' + rgbaToArgbHex(color.r, color.g, color.b, color.a);\n var secondHex8String = hex8String;\n var gradientType = color.gradientType ? 'GradientType = 1, ' : '';\n if (secondColor) {\n var s = new TinyColor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s.r, s.g, s.b, s.a);\n }\n return \"progid:DXImageTransform.Microsoft.gradient(\".concat(gradientType, \"startColorstr=\").concat(hex8String, \",endColorstr=\").concat(secondHex8String, \")\");\n}\n"],"names":["names","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","goldenrod","gold","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavenderblush","lavender","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","bound01","n","max","indexOf","parseFloat","isOnePointZero","isPercent","isPercentage","Math","min","parseInt","String","abs","clamp01","val","boundAlpha","a","isNaN","convertToPercentage","concat","Number","pad2","c","length","rgbToHsl","r","g","b","h","s","l","d","hue2rgb","p","q","t","rgbToHsv","v","rgbToHex","allow3Char","hex","round","toString","startsWith","charAt","join","rgbaToArgbHex","convertDecimalToHex","convertHexToDecimal","parseIntFromHex","inputToRGB","color","rgb","ok","format","stringInputToObject","isValidCSSUnit","substr","i","floor","f","mod","hsvToRgb","hslToRgb","Object","prototype","hasOwnProperty","call","CSS_UNIT","PERMISSIVE_MATCH3","PERMISSIVE_MATCH4","matchers","RegExp","rgba","hsl","hsla","hsv","hsva","hex3","hex6","hex4","hex8","trim","toLowerCase","named","match","exec","Boolean","TinyColor","opts","_a","numberInputToObject","this","originalInput","roundA","gradientType","isValid","isDark","getBrightness","isLight","toRgb","getLuminance","RsRGB","GsRGB","BsRGB","pow","getAlpha","setAlpha","alpha","isMonochrome","toHsl","toHsv","toHsvString","toHslString","toHex","toHexString","toHex8","allow4Char","rgbaToHex","toHex8String","toHexShortString","allowShortChar","toRgbString","toPercentageRgb","fmt","x","toPercentageRgbString","rnd","toName","_i","entries","_b","key","formatSet","formattedString","hasAlpha","toNumber","clone","lighten","amount","brighten","darken","tint","mix","shade","desaturate","saturate","greyscale","spin","hue","rgb1","rgb2","analogous","results","slices","part","ret","push","complement","monochromatic","res","modification","splitcomplement","onBackground","background","fg","bg","triad","polyad","tetrad","result","increment","equals","getColorInfo","bounds_1","bounds","defineColor","hueRange","Error","randomWithin","range","seed","undefined","random","bound","sMin","lowerBounds","sMax","bMin","bMax","name","saturationRange","brightnessRange","readability","color1","color2","c1","c2","tinycolorumd","mostReadable","baseColor","colorList","args","includeFallbackColors","level","size","bestColor","bestScore","colorList_1","score","wcag2","readabilityLevel","isReadable","options","count","totalColors","colors","colorInput","num","namedColor","find","parsed","getHueRange","pickHue","luminosity","pickSaturation","H","S","s1","v1","s2","v2","m","getMinimumBrightness","pickBrightness","fromRatio","ratio","newColor","legacyRandom","toMsFilter","firstColor","secondColor","hex8String","secondHex8String"],"mappings":"0OAIO,IAAIA,EAAQ,CACfC,UAAW,UACXC,aAAc,UACdC,KAAM,UACNC,WAAY,UACZC,MAAO,UACPC,MAAO,UACPC,OAAQ,UACRC,MAAO,UACPC,eAAgB,UAChBC,KAAM,UACNC,WAAY,UACZC,MAAO,UACPC,UAAW,UACXC,UAAW,UACXC,WAAY,UACZC,UAAW,UACXC,MAAO,UACPC,eAAgB,UAChBC,SAAU,UACVC,QAAS,UACTC,KAAM,UACNC,SAAU,UACVC,SAAU,UACVC,cAAe,UACfC,SAAU,UACVC,UAAW,UACXC,SAAU,UACVC,UAAW,UACXC,YAAa,UACbC,eAAgB,UAChBC,WAAY,UACZC,WAAY,UACZC,QAAS,UACTC,WAAY,UACZC,aAAc,UACdC,cAAe,UACfC,cAAe,UACfC,cAAe,UACfC,cAAe,UACfC,WAAY,UACZC,SAAU,UACVC,YAAa,UACbC,QAAS,UACTC,QAAS,UACTC,WAAY,UACZC,UAAW,UACXC,YAAa,UACbC,YAAa,UACbC,QAAS,UACTC,UAAW,UACXC,WAAY,UACZC,UAAW,UACXC,KAAM,UACNC,KAAM,UACNC,MAAO,UACPC,YAAa,UACbC,KAAM,UACNC,SAAU,UACVC,QAAS,UACTC,UAAW,UACXC,OAAQ,UACRC,MAAO,UACPC,MAAO,UACPC,cAAe,UACfC,SAAU,UACVC,UAAW,UACXC,aAAc,UACdC,UAAW,UACXC,WAAY,UACZC,UAAW,UACXC,qBAAsB,UACtBC,UAAW,UACXC,WAAY,UACZC,UAAW,UACXC,UAAW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AM,CAAEpI,EAAGA,EAAGC,EAAGA,EAAGQ,EAAGA,GAK3B,YAJsBiJ,IAAlB+B,EAAQzG,QACRoD,EAAIhJ,EAAIqM,EAAQzG,OAGb,IAAIpB,EAAUwE,EACzB,EEzBAsC,EAAa3V,MAAQA,EACrB2V,EAAaqC,UCPN,SAAmBC,EAAOnJ,GAC7B,IAAIoJ,EAAW,CACXpN,EAAGP,EAAoB0N,EAAMnN,GAC7BC,EAAGR,EAAoB0N,EAAMlN,GAC7BC,EAAGT,EAAoB0N,EAAMjN,IAKjC,YAHgB2J,IAAZsD,EAAM5N,IACN6N,EAAS7N,EAAII,OAAOwN,EAAM5N,IAEvB,IAAIwE,EAAUqJ,EAAUpJ,EACnC,EDFA6G,EAAawC,aCIN,WACH,OAAO,IAAItJ,EAAU,CACjB/D,EAAGjB,KAAK+K,SACR7J,EAAGlB,KAAK+K,SACR5J,EAAGnB,KAAK+K,UAEhB,EDTAe,EAAayC,WEVN,SAAoBC,EAAYC,GACnC,IAAI9L,EAAQ,IAAIqC,EAAUwJ,GACtBE,EAAa,IAAMpM,EAAcK,EAAM1B,EAAG0B,EAAMzB,EAAGyB,EAAMxB,EAAGwB,EAAMnC,GAClEmO,EAAmBD,EACnBnJ,EAAe5C,EAAM4C,aAAe,qBAAuB,GAC/D,GAAIkJ,EAAa,CACb,IAAIpN,EAAI,IAAI2D,EAAUyJ,GACtBE,EAAmB,IAAMrM,EAAcjB,EAAEJ,EAAGI,EAAEH,EAAGG,EAAEF,EAAGE,EAAEb,EAC3D,CACD,MAAO,8CAA8CG,OAAO4E,EAAc,kBAAkB5E,OAAO+N,EAAY,iBAAiB/N,OAAOgO,EAAkB,IAC7J,EFCA7C,EAAapJ,WAAaA,EAC1BoJ,EAAa/I,oBAAsBA,EACnC+I,EAAa9I,eAAiBA"}
1
+ {"version":3,"file":"tinycolor.umd.min.js","sources":["../module/css-color-names.js","../module/util.js","../module/conversion.js","../module/format-input.js","../module/index.js","../module/random.js","../module/readability.js","../module/umd_api.js","../module/from-ratio.js","../module/to-ms-filter.js"],"sourcesContent":["// https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json\n/**\n * @hidden\n */\nexport const names = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n goldenrod: '#daa520',\n gold: '#ffd700',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n lavenderblush: '#fff0f5',\n lavender: '#e6e6fa',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32',\n};\n","/**\n * Take input from [0, n] and return it as [0, 1]\n * @hidden\n */\nexport function bound01(n, max) {\n if (isOnePointZero(n)) {\n n = '100%';\n }\n const isPercent = isPercentage(n);\n n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));\n // Automatically convert percentage into number\n if (isPercent) {\n n = parseInt(String(n * max), 10) / 100;\n }\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n // Convert into [0, 1] range if it isn't already\n if (max === 360) {\n // If n is a hue given in degrees,\n // wrap around out-of-range values into [0, 360] range\n // then convert into [0, 1].\n n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));\n }\n else {\n // If n not a hue given in degrees\n // Convert into [0, 1] range if it isn't already.\n n = (n % max) / parseFloat(String(max));\n }\n return n;\n}\n/**\n * Force a number between 0 and 1\n * @hidden\n */\nexport function clamp01(val) {\n return Math.min(1, Math.max(0, val));\n}\n/**\n * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>\n * @hidden\n */\nexport function isOnePointZero(n) {\n return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;\n}\n/**\n * Check to see if string passed in is a percentage\n * @hidden\n */\nexport function isPercentage(n) {\n return typeof n === 'string' && n.indexOf('%') !== -1;\n}\n/**\n * Return a valid alpha value [0,1] with all invalid values being set to 1\n * @hidden\n */\nexport function boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n}\n/**\n * Replace a decimal with it's percentage value\n * @hidden\n */\nexport function convertToPercentage(n) {\n if (Number(n) <= 1) {\n return `${Number(n) * 100}%`;\n }\n return n;\n}\n/**\n * Force a hex value to have 2 characters\n * @hidden\n */\nexport function pad2(c) {\n return c.length === 1 ? '0' + c : String(c);\n}\n","import { bound01, pad2 } from './util.js';\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>\n/**\n * Handle bounds / percentage checking to conform to CSS color spec\n * <http://www.w3.org/TR/css3-color/>\n * *Assumes:* r, g, b in [0, 255] or [0, 1]\n * *Returns:* { r, g, b } in [0, 255]\n */\nexport function rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255,\n };\n}\n/**\n * Converts an RGB color value to HSL.\n * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n * *Returns:* { h, s, l } in [0,1]\n */\nexport function rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0;\n let s = 0;\n const l = (max + min) / 2;\n if (max === min) {\n s = 0;\n h = 0; // achromatic\n }\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h, s, l };\n}\nfunction hue2rgb(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * (6 * t);\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n}\n/**\n * Converts an HSL color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nexport function hslToRgb(h, s, l) {\n let r;\n let g;\n let b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n if (s === 0) {\n // achromatic\n g = l;\n b = l;\n r = l;\n }\n else {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color value to HSV\n *\n * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n * *Returns:* { h, s, v } in [0,1]\n */\nexport function rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h = 0;\n const v = max;\n const d = max - min;\n const s = max === 0 ? 0 : d / max;\n if (max === min) {\n h = 0; // achromatic\n }\n else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n default:\n break;\n }\n h /= 6;\n }\n return { h, s, v };\n}\n/**\n * Converts an HSV color value to RGB.\n *\n * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n * *Returns:* { r, g, b } in the set [0, 255]\n */\nexport function hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n const i = Math.floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n const mod = i % 6;\n const r = [v, q, p, p, t, v][mod];\n const g = [t, v, v, q, p, p][mod];\n const b = [p, p, t, v, v, q][mod];\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n/**\n * Converts an RGB color to hex\n *\n * Assumes r, g, and b are contained in the set [0, 255]\n * Returns a 3 or 6 character hex\n */\nexport function rgbToHex(r, g, b, allow3Char) {\n const hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n // Return a 3 character hex if possible\n if (allow3Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join('');\n}\n/**\n * Converts an RGBA color plus alpha transparency to hex\n *\n * Assumes r, g, b are contained in the set [0, 255] and\n * a in [0, 1]. Returns a 4 or 8 character rgba hex\n */\n// eslint-disable-next-line max-params\nexport function rgbaToHex(r, g, b, a, allow4Char) {\n const hex = [\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n pad2(convertDecimalToHex(a)),\n ];\n // Return a 4 character hex if possible\n if (allow4Char &&\n hex[0].startsWith(hex[0].charAt(1)) &&\n hex[1].startsWith(hex[1].charAt(1)) &&\n hex[2].startsWith(hex[2].charAt(1)) &&\n hex[3].startsWith(hex[3].charAt(1))) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join('');\n}\n/**\n * Converts an RGBA color to an ARGB Hex8 string\n * Rarely used, but required for \"toFilter()\"\n */\nexport function rgbaToArgbHex(r, g, b, a) {\n const hex = [\n pad2(convertDecimalToHex(a)),\n pad2(Math.round(r).toString(16)),\n pad2(Math.round(g).toString(16)),\n pad2(Math.round(b).toString(16)),\n ];\n return hex.join('');\n}\n/** Converts a decimal to a hex value */\nexport function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n/** Converts a hex value to a decimal */\nexport function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}\n/** Parse a base-16 hex value into a base-10 integer */\nexport function parseIntFromHex(val) {\n return parseInt(val, 16);\n}\nexport function numberInputToObject(color) {\n return {\n r: color >> 16,\n g: (color & 0xff00) >> 8,\n b: color & 0xff,\n };\n}\n","import { convertHexToDecimal, hslToRgb, hsvToRgb, parseIntFromHex, rgbToRgb, } from './conversion.js';\nimport { names } from './css-color-names.js';\nimport { boundAlpha, convertToPercentage } from './util.js';\n/**\n * Given a string or object, convert that input to RGB\n *\n * Possible string inputs:\n * ```\n * \"red\"\n * \"#f00\" or \"f00\"\n * \"#ff0000\" or \"ff0000\"\n * \"#ff000000\" or \"ff000000\"\n * \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n * \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n * \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n * \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n * \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n * \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n * \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n * ```\n */\nexport function inputToRGB(color) {\n let rgb = { r: 0, g: 0, b: 0 };\n let a = 1;\n let s = null;\n let v = null;\n let l = null;\n let ok = false;\n let format = false;\n if (typeof color === 'string') {\n color = stringInputToObject(color);\n }\n if (typeof color === 'object') {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = 'hsv';\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = 'hsl';\n }\n if (Object.prototype.hasOwnProperty.call(color, 'a')) {\n a = color.a;\n }\n }\n a = boundAlpha(a);\n return {\n ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a,\n };\n}\n// <http://www.w3.org/TR/css3-values/#integers>\nconst CSS_INTEGER = '[-\\\\+]?\\\\d+%?';\n// <http://www.w3.org/TR/css3-values/#number-value>\nconst CSS_NUMBER = '[-\\\\+]?\\\\d*\\\\.\\\\d+%?';\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\nconst CSS_UNIT = `(?:${CSS_NUMBER})|(?:${CSS_INTEGER})`;\n// Actual matching.\n// Parentheses and commas are optional, but not required.\n// Whitespace can take the place of commas or opening paren\nconst PERMISSIVE_MATCH3 = `[\\\\s|\\\\(]+(${CSS_UNIT})[,|\\\\s]+(${CSS_UNIT})[,|\\\\s]+(${CSS_UNIT})\\\\s*\\\\)?`;\nconst PERMISSIVE_MATCH4 = `[\\\\s|\\\\(]+(${CSS_UNIT})[,|\\\\s]+(${CSS_UNIT})[,|\\\\s]+(${CSS_UNIT})[,|\\\\s]+(${CSS_UNIT})\\\\s*\\\\)?`;\nconst matchers = {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),\n rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),\n hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),\n hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),\n hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),\n hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n};\n/**\n * Permissive string parsing. Take in a number of formats, and output an object\n * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\n */\nexport function stringInputToObject(color) {\n color = color.trim().toLowerCase();\n if (color.length === 0) {\n return false;\n }\n let named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color === 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: 'name' };\n }\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n let match = matchers.rgb.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n match = matchers.rgba.exec(color);\n if (match) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n match = matchers.hsl.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n match = matchers.hsla.exec(color);\n if (match) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n match = matchers.hsv.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n match = matchers.hsva.exec(color);\n if (match) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n match = matchers.hex8.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex6.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n match = matchers.hex4.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1] + match[1]),\n g: parseIntFromHex(match[2] + match[2]),\n b: parseIntFromHex(match[3] + match[3]),\n a: convertHexToDecimal(match[4] + match[4]),\n format: named ? 'name' : 'hex8',\n };\n }\n match = matchers.hex3.exec(color);\n if (match) {\n return {\n r: parseIntFromHex(match[1] + match[1]),\n g: parseIntFromHex(match[2] + match[2]),\n b: parseIntFromHex(match[3] + match[3]),\n format: named ? 'name' : 'hex',\n };\n }\n return false;\n}\n/**\n * Check to see if it looks like a CSS unit\n * (see `matchers` above for definition).\n */\nexport function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}\n","import { numberInputToObject, rgbaToHex, rgbToHex, rgbToHsl, rgbToHsv } from './conversion.js';\nimport { names } from './css-color-names.js';\nimport { inputToRGB } from './format-input.js';\nimport { bound01, boundAlpha, clamp01 } from './util.js';\nexport class TinyColor {\n constructor(color = '', opts = {}) {\n // If input is already a tinycolor, return itself\n if (color instanceof TinyColor) {\n // eslint-disable-next-line no-constructor-return\n return color;\n }\n if (typeof color === 'number') {\n color = numberInputToObject(color);\n }\n this.originalInput = color;\n const rgb = inputToRGB(color);\n this.originalInput = color;\n this.r = rgb.r;\n this.g = rgb.g;\n this.b = rgb.b;\n this.a = rgb.a;\n this.roundA = Math.round(100 * this.a) / 100;\n this.format = opts.format ?? rgb.format;\n this.gradientType = opts.gradientType;\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this.r < 1) {\n this.r = Math.round(this.r);\n }\n if (this.g < 1) {\n this.g = Math.round(this.g);\n }\n if (this.b < 1) {\n this.b = Math.round(this.b);\n }\n this.isValid = rgb.ok;\n }\n isDark() {\n return this.getBrightness() < 128;\n }\n isLight() {\n return !this.isDark();\n }\n /**\n * Returns the perceived brightness of the color, from 0-255.\n */\n getBrightness() {\n // http://www.w3.org/TR/AERT#color-contrast\n const rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n }\n /**\n * Returns the perceived luminance of a color, from 0-1.\n */\n getLuminance() {\n // http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n const rgb = this.toRgb();\n let R;\n let G;\n let B;\n const RsRGB = rgb.r / 255;\n const GsRGB = rgb.g / 255;\n const BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) {\n R = RsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n }\n if (GsRGB <= 0.03928) {\n G = GsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n }\n if (BsRGB <= 0.03928) {\n B = BsRGB / 12.92;\n }\n else {\n // eslint-disable-next-line prefer-exponentiation-operator\n B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n }\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n }\n /**\n * Returns the alpha value of a color, from 0-1.\n */\n getAlpha() {\n return this.a;\n }\n /**\n * Sets the alpha value on the current color.\n *\n * @param alpha - The new alpha value. The accepted range is 0-1.\n */\n setAlpha(alpha) {\n this.a = boundAlpha(alpha);\n this.roundA = Math.round(100 * this.a) / 100;\n return this;\n }\n /**\n * Returns whether the color is monochrome.\n */\n isMonochrome() {\n const { s } = this.toHsl();\n return s === 0;\n }\n /**\n * Returns the object as a HSVA object.\n */\n toHsv() {\n const hsv = rgbToHsv(this.r, this.g, this.b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };\n }\n /**\n * Returns the hsva values interpolated into a string with the following format:\n * \"hsva(xxx, xxx, xxx, xx)\".\n */\n toHsvString() {\n const hsv = rgbToHsv(this.r, this.g, this.b);\n const h = Math.round(hsv.h * 360);\n const s = Math.round(hsv.s * 100);\n const v = Math.round(hsv.v * 100);\n return this.a === 1 ? `hsv(${h}, ${s}%, ${v}%)` : `hsva(${h}, ${s}%, ${v}%, ${this.roundA})`;\n }\n /**\n * Returns the object as a HSLA object.\n */\n toHsl() {\n const hsl = rgbToHsl(this.r, this.g, this.b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };\n }\n /**\n * Returns the hsla values interpolated into a string with the following format:\n * \"hsla(xxx, xxx, xxx, xx)\".\n */\n toHslString() {\n const hsl = rgbToHsl(this.r, this.g, this.b);\n const h = Math.round(hsl.h * 360);\n const s = Math.round(hsl.s * 100);\n const l = Math.round(hsl.l * 100);\n return this.a === 1 ? `hsl(${h}, ${s}%, ${l}%)` : `hsla(${h}, ${s}%, ${l}%, ${this.roundA})`;\n }\n /**\n * Returns the hex value of the color.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n toHex(allow3Char = false) {\n return rgbToHex(this.r, this.g, this.b, allow3Char);\n }\n /**\n * Returns the hex value of the color -with a # prefixed.\n * @param allow3Char will shorten hex value to 3 char if possible\n */\n toHexString(allow3Char = false) {\n return '#' + this.toHex(allow3Char);\n }\n /**\n * Returns the hex 8 value of the color.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n toHex8(allow4Char = false) {\n return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);\n }\n /**\n * Returns the hex 8 value of the color -with a # prefixed.\n * @param allow4Char will shorten hex value to 4 char if possible\n */\n toHex8String(allow4Char = false) {\n return '#' + this.toHex8(allow4Char);\n }\n /**\n * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.\n * @param allowShortChar will shorten hex value to 3 or 4 char if possible\n */\n toHexShortString(allowShortChar = false) {\n return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);\n }\n /**\n * Returns the object as a RGBA object.\n */\n toRgb() {\n return {\n r: Math.round(this.r),\n g: Math.round(this.g),\n b: Math.round(this.b),\n a: this.a,\n };\n }\n /**\n * Returns the RGBA values interpolated into a string with the following format:\n * \"RGBA(xxx, xxx, xxx, xx)\".\n */\n toRgbString() {\n const r = Math.round(this.r);\n const g = Math.round(this.g);\n const b = Math.round(this.b);\n return this.a === 1 ? `rgb(${r}, ${g}, ${b})` : `rgba(${r}, ${g}, ${b}, ${this.roundA})`;\n }\n /**\n * Returns the object as a RGBA object.\n */\n toPercentageRgb() {\n const fmt = (x) => `${Math.round(bound01(x, 255) * 100)}%`;\n return {\n r: fmt(this.r),\n g: fmt(this.g),\n b: fmt(this.b),\n a: this.a,\n };\n }\n /**\n * Returns the RGBA relative values interpolated into a string\n */\n toPercentageRgbString() {\n const rnd = (x) => Math.round(bound01(x, 255) * 100);\n return this.a === 1\n ? `rgb(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%)`\n : `rgba(${rnd(this.r)}%, ${rnd(this.g)}%, ${rnd(this.b)}%, ${this.roundA})`;\n }\n /**\n * The 'real' name of the color -if there is one.\n */\n toName() {\n if (this.a === 0) {\n return 'transparent';\n }\n if (this.a < 1) {\n return false;\n }\n const hex = '#' + rgbToHex(this.r, this.g, this.b, false);\n for (const [key, value] of Object.entries(names)) {\n if (hex === value) {\n return key;\n }\n }\n return false;\n }\n toString(format) {\n const formatSet = Boolean(format);\n format = format ?? this.format;\n let formattedString = false;\n const hasAlpha = this.a < 1 && this.a >= 0;\n const needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith('hex') || format === 'name');\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === 'name' && this.a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === 'rgb') {\n formattedString = this.toRgbString();\n }\n if (format === 'prgb') {\n formattedString = this.toPercentageRgbString();\n }\n if (format === 'hex' || format === 'hex6') {\n formattedString = this.toHexString();\n }\n if (format === 'hex3') {\n formattedString = this.toHexString(true);\n }\n if (format === 'hex4') {\n formattedString = this.toHex8String(true);\n }\n if (format === 'hex8') {\n formattedString = this.toHex8String();\n }\n if (format === 'name') {\n formattedString = this.toName();\n }\n if (format === 'hsl') {\n formattedString = this.toHslString();\n }\n if (format === 'hsv') {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n }\n toNumber() {\n return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);\n }\n clone() {\n return new TinyColor(this.toString());\n }\n /**\n * Lighten the color a given amount. Providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n lighten(amount = 10) {\n const hsl = this.toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n }\n /**\n * Brighten the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n brighten(amount = 10) {\n const rgb = this.toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return new TinyColor(rgb);\n }\n /**\n * Darken the color a given amount, from 0 to 100.\n * Providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n darken(amount = 10) {\n const hsl = this.toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return new TinyColor(hsl);\n }\n /**\n * Mix the color with pure white, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return white.\n * @param amount - valid between 1-100\n */\n tint(amount = 10) {\n return this.mix('white', amount);\n }\n /**\n * Mix the color with pure black, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return black.\n * @param amount - valid between 1-100\n */\n shade(amount = 10) {\n return this.mix('black', amount);\n }\n /**\n * Desaturate the color a given amount, from 0 to 100.\n * Providing 100 will is the same as calling greyscale\n * @param amount - valid between 1-100\n */\n desaturate(amount = 10) {\n const hsl = this.toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n }\n /**\n * Saturate the color a given amount, from 0 to 100.\n * @param amount - valid between 1-100\n */\n saturate(amount = 10) {\n const hsl = this.toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return new TinyColor(hsl);\n }\n /**\n * Completely desaturates a color into greyscale.\n * Same as calling `desaturate(100)`\n */\n greyscale() {\n return this.desaturate(100);\n }\n /**\n * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n * Values outside of this range will be wrapped into this range.\n */\n spin(amount) {\n const hsl = this.toHsl();\n const hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return new TinyColor(hsl);\n }\n /**\n * Mix the current color a given amount with another color, from 0 to 100.\n * 0 means no mixing (return current color).\n */\n mix(color, amount = 50) {\n const rgb1 = this.toRgb();\n const rgb2 = new TinyColor(color).toRgb();\n const p = amount / 100;\n const rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a,\n };\n return new TinyColor(rgba);\n }\n analogous(results = 6, slices = 30) {\n const hsl = this.toHsl();\n const part = 360 / slices;\n const ret = [this];\n for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(new TinyColor(hsl));\n }\n return ret;\n }\n /**\n * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js\n */\n complement() {\n const hsl = this.toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return new TinyColor(hsl);\n }\n monochromatic(results = 6) {\n const hsv = this.toHsv();\n const { h } = hsv;\n const { s } = hsv;\n let { v } = hsv;\n const res = [];\n const modification = 1 / results;\n while (results--) {\n res.push(new TinyColor({ h, s, v }));\n v = (v + modification) % 1;\n }\n return res;\n }\n splitcomplement() {\n const hsl = this.toHsl();\n const { h } = hsl;\n return [\n this,\n new TinyColor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),\n new TinyColor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),\n ];\n }\n /**\n * Compute how the color would appear on a background\n */\n onBackground(background) {\n const fg = this.toRgb();\n const bg = new TinyColor(background).toRgb();\n const alpha = fg.a + bg.a * (1 - fg.a);\n return new TinyColor({\n r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,\n g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,\n b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,\n a: alpha,\n });\n }\n /**\n * Alias for `polyad(3)`\n */\n triad() {\n return this.polyad(3);\n }\n /**\n * Alias for `polyad(4)`\n */\n tetrad() {\n return this.polyad(4);\n }\n /**\n * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)\n * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...\n */\n polyad(n) {\n const hsl = this.toHsl();\n const { h } = hsl;\n const result = [this];\n const increment = 360 / n;\n for (let i = 1; i < n; i++) {\n result.push(new TinyColor({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));\n }\n return result;\n }\n /**\n * compare color vs current color\n */\n equals(color) {\n return this.toRgbString() === new TinyColor(color).toRgbString();\n }\n}\n","// randomColor by David Merfield under the CC0 license\n// https://github.com/davidmerfield/randomColor/\nimport { TinyColor } from './index.js';\nexport function random(options = {}) {\n // Check if we need to generate multiple colors\n if (options.count !== undefined &&\n options.count !== null) {\n const totalColors = options.count;\n const colors = [];\n options.count = undefined;\n while (totalColors > colors.length) {\n // Since we're generating multiple colors,\n // incremement the seed. Otherwise we'd just\n // generate the same color each time...\n options.count = null;\n if (options.seed) {\n options.seed += 1;\n }\n colors.push(random(options));\n }\n options.count = totalColors;\n return colors;\n }\n // First we pick a hue (H)\n const h = pickHue(options.hue, options.seed);\n // Then use H to determine saturation (S)\n const s = pickSaturation(h, options);\n // Then use S and H to determine brightness (B).\n const v = pickBrightness(h, s, options);\n const res = { h, s, v };\n if (options.alpha !== undefined) {\n res.a = options.alpha;\n }\n // Then we return the HSB color in the desired format\n return new TinyColor(res);\n}\nfunction pickHue(hue, seed) {\n const hueRange = getHueRange(hue);\n let res = randomWithin(hueRange, seed);\n // Instead of storing red as two seperate ranges,\n // we group them, using negative numbers\n if (res < 0) {\n res = 360 + res;\n }\n return res;\n}\nfunction pickSaturation(hue, options) {\n if (options.hue === 'monochrome') {\n return 0;\n }\n if (options.luminosity === 'random') {\n return randomWithin([0, 100], options.seed);\n }\n const { saturationRange } = getColorInfo(hue);\n let sMin = saturationRange[0];\n let sMax = saturationRange[1];\n switch (options.luminosity) {\n case 'bright':\n sMin = 55;\n break;\n case 'dark':\n sMin = sMax - 10;\n break;\n case 'light':\n sMax = 55;\n break;\n default:\n break;\n }\n return randomWithin([sMin, sMax], options.seed);\n}\nfunction pickBrightness(H, S, options) {\n let bMin = getMinimumBrightness(H, S);\n let bMax = 100;\n switch (options.luminosity) {\n case 'dark':\n bMax = bMin + 20;\n break;\n case 'light':\n bMin = (bMax + bMin) / 2;\n break;\n case 'random':\n bMin = 0;\n bMax = 100;\n break;\n default:\n break;\n }\n return randomWithin([bMin, bMax], options.seed);\n}\nfunction getMinimumBrightness(H, S) {\n const { lowerBounds } = getColorInfo(H);\n for (let i = 0; i < lowerBounds.length - 1; i++) {\n const s1 = lowerBounds[i][0];\n const v1 = lowerBounds[i][1];\n const s2 = lowerBounds[i + 1][0];\n const v2 = lowerBounds[i + 1][1];\n if (S >= s1 && S <= s2) {\n const m = (v2 - v1) / (s2 - s1);\n const b = v1 - m * s1;\n return m * S + b;\n }\n }\n return 0;\n}\nfunction getHueRange(colorInput) {\n const num = parseInt(colorInput, 10);\n if (!Number.isNaN(num) && num < 360 && num > 0) {\n return [num, num];\n }\n if (typeof colorInput === 'string') {\n const namedColor = bounds.find(n => n.name === colorInput);\n if (namedColor) {\n const color = defineColor(namedColor);\n if (color.hueRange) {\n return color.hueRange;\n }\n }\n const parsed = new TinyColor(colorInput);\n if (parsed.isValid) {\n const hue = parsed.toHsv().h;\n return [hue, hue];\n }\n }\n return [0, 360];\n}\nfunction getColorInfo(hue) {\n // Maps red colors to make picking hue easier\n if (hue >= 334 && hue <= 360) {\n hue -= 360;\n }\n for (const bound of bounds) {\n const color = defineColor(bound);\n if (color.hueRange && hue >= color.hueRange[0] && hue <= color.hueRange[1]) {\n return color;\n }\n }\n throw Error('Color not found');\n}\nfunction randomWithin(range, seed) {\n if (seed === undefined) {\n return Math.floor(range[0] + Math.random() * (range[1] + 1 - range[0]));\n }\n // Seeded random algorithm from http://indiegamr.com/generate-repeatable-random-numbers-in-js/\n const max = range[1] || 1;\n const min = range[0] || 0;\n seed = (seed * 9301 + 49297) % 233280;\n const rnd = seed / 233280.0;\n return Math.floor(min + rnd * (max - min));\n}\nfunction defineColor(bound) {\n const sMin = bound.lowerBounds[0][0];\n const sMax = bound.lowerBounds[bound.lowerBounds.length - 1][0];\n const bMin = bound.lowerBounds[bound.lowerBounds.length - 1][1];\n const bMax = bound.lowerBounds[0][1];\n return {\n name: bound.name,\n hueRange: bound.hueRange,\n lowerBounds: bound.lowerBounds,\n saturationRange: [sMin, sMax],\n brightnessRange: [bMin, bMax],\n };\n}\n/**\n * @hidden\n */\nexport const bounds = [\n {\n name: 'monochrome',\n hueRange: null,\n lowerBounds: [\n [0, 0],\n [100, 0],\n ],\n },\n {\n name: 'red',\n hueRange: [-26, 18],\n lowerBounds: [\n [20, 100],\n [30, 92],\n [40, 89],\n [50, 85],\n [60, 78],\n [70, 70],\n [80, 60],\n [90, 55],\n [100, 50],\n ],\n },\n {\n name: 'orange',\n hueRange: [19, 46],\n lowerBounds: [\n [20, 100],\n [30, 93],\n [40, 88],\n [50, 86],\n [60, 85],\n [70, 70],\n [100, 70],\n ],\n },\n {\n name: 'yellow',\n hueRange: [47, 62],\n lowerBounds: [\n [25, 100],\n [40, 94],\n [50, 89],\n [60, 86],\n [70, 84],\n [80, 82],\n [90, 80],\n [100, 75],\n ],\n },\n {\n name: 'green',\n hueRange: [63, 178],\n lowerBounds: [\n [30, 100],\n [40, 90],\n [50, 85],\n [60, 81],\n [70, 74],\n [80, 64],\n [90, 50],\n [100, 40],\n ],\n },\n {\n name: 'blue',\n hueRange: [179, 257],\n lowerBounds: [\n [20, 100],\n [30, 86],\n [40, 80],\n [50, 74],\n [60, 60],\n [70, 52],\n [80, 44],\n [90, 39],\n [100, 35],\n ],\n },\n {\n name: 'purple',\n hueRange: [258, 282],\n lowerBounds: [\n [20, 100],\n [30, 87],\n [40, 79],\n [50, 70],\n [60, 65],\n [70, 59],\n [80, 52],\n [90, 45],\n [100, 42],\n ],\n },\n {\n name: 'pink',\n hueRange: [283, 334],\n lowerBounds: [\n [20, 100],\n [30, 90],\n [40, 86],\n [60, 84],\n [80, 80],\n [90, 75],\n [100, 73],\n ],\n },\n];\n","import { TinyColor } from './index.js';\n// Readability Functions\n// ---------------------\n// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)\n/**\n * AKA `contrast`\n *\n * Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)\n */\nexport function readability(color1, color2) {\n const c1 = new TinyColor(color1);\n const c2 = new TinyColor(color2);\n return ((Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) /\n (Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05));\n}\n/**\n * Ensure that foreground and background color combinations meet WCAG2 guidelines.\n * The third argument is an object.\n * the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';\n * the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.\n * If the entire object is absent, isReadable defaults to {level:\"AA\",size:\"small\"}.\n *\n * Example\n * ```ts\n * new TinyColor().isReadable('#000', '#111') => false\n * new TinyColor().isReadable('#000', '#111', { level: 'AA', size: 'large' }) => false\n * ```\n */\nexport function isReadable(color1, color2, wcag2 = { level: 'AA', size: 'small' }) {\n const readabilityLevel = readability(color1, color2);\n switch ((wcag2.level ?? 'AA') + (wcag2.size ?? 'small')) {\n case 'AAsmall':\n case 'AAAlarge':\n return readabilityLevel >= 4.5;\n case 'AAlarge':\n return readabilityLevel >= 3;\n case 'AAAsmall':\n return readabilityLevel >= 7;\n default:\n return false;\n }\n}\n/**\n * Given a base color and a list of possible foreground or background\n * colors for that base, returns the most readable color.\n * Optionally returns Black or White if the most readable color is unreadable.\n *\n * @param baseColor - the base color.\n * @param colorList - array of colors to pick the most readable one from.\n * @param args - and object with extra arguments\n *\n * Example\n * ```ts\n * new TinyColor().mostReadable('#123', ['#124\", \"#125'], { includeFallbackColors: false }).toHexString(); // \"#112255\"\n * new TinyColor().mostReadable('#123', ['#124\", \"#125'],{ includeFallbackColors: true }).toHexString(); // \"#ffffff\"\n * new TinyColor().mostReadable('#a8015a', [\"#faf3f3\"], { includeFallbackColors:true, level: 'AAA', size: 'large' }).toHexString(); // \"#faf3f3\"\n * new TinyColor().mostReadable('#a8015a', [\"#faf3f3\"], { includeFallbackColors:true, level: 'AAA', size: 'small' }).toHexString(); // \"#ffffff\"\n * ```\n */\nexport function mostReadable(baseColor, colorList, args = { includeFallbackColors: false, level: 'AA', size: 'small' }) {\n let bestColor = null;\n let bestScore = 0;\n const { includeFallbackColors, level, size } = args;\n for (const color of colorList) {\n const score = readability(baseColor, color);\n if (score > bestScore) {\n bestScore = score;\n bestColor = new TinyColor(color);\n }\n }\n if (isReadable(baseColor, bestColor, { level, size }) || !includeFallbackColors) {\n return bestColor;\n }\n args.includeFallbackColors = false;\n return mostReadable(baseColor, ['#fff', '#000'], args);\n}\n","import { names } from './css-color-names.js';\nimport { inputToRGB, isValidCSSUnit, stringInputToObject } from './format-input.js';\nimport { fromRatio, legacyRandom } from './from-ratio.js';\nimport { TinyColor } from './index.js';\nimport { random } from './random.js';\nimport { mostReadable, readability } from './readability.js';\nimport { toMsFilter } from './to-ms-filter.js';\nconst tinycolorumd = {\n TinyColor,\n readability,\n mostReadable,\n random,\n names,\n fromRatio,\n legacyRandom,\n toMsFilter,\n inputToRGB,\n stringInputToObject,\n isValidCSSUnit,\n};\nexport default tinycolorumd;\n","import { TinyColor } from './index.js';\nimport { convertToPercentage } from './util.js';\n/**\n * If input is an object, force 1 into \"1.0\" to handle ratios properly\n * String input requires \"1.0\" as input, so 1 will be treated as 1\n */\nexport function fromRatio(ratio, opts) {\n const newColor = {\n r: convertToPercentage(ratio.r),\n g: convertToPercentage(ratio.g),\n b: convertToPercentage(ratio.b),\n };\n if (ratio.a !== undefined) {\n newColor.a = Number(ratio.a);\n }\n return new TinyColor(newColor, opts);\n}\n/** old random function */\nexport function legacyRandom() {\n return new TinyColor({\n r: Math.random(),\n g: Math.random(),\n b: Math.random(),\n });\n}\n","import { rgbaToArgbHex } from './conversion.js';\nimport { TinyColor } from './index.js';\n/**\n * Returns the color represented as a Microsoft filter for use in old versions of IE.\n */\nexport function toMsFilter(firstColor, secondColor) {\n const color = new TinyColor(firstColor);\n const hex8String = '#' + rgbaToArgbHex(color.r, color.g, color.b, color.a);\n let secondHex8String = hex8String;\n const gradientType = color.gradientType ? 'GradientType = 1, ' : '';\n if (secondColor) {\n const s = new TinyColor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s.r, s.g, s.b, s.a);\n }\n return `progid:DXImageTransform.Microsoft.gradient(${gradientType}startColorstr=${hex8String},endColorstr=${secondHex8String})`;\n}\n"],"names":["names","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","goldenrod","gold","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavenderblush","lavender","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","bound01","n","max","indexOf","parseFloat","isOnePointZero","isPercent","isPercentage","Math","min","parseInt","String","abs","clamp01","val","boundAlpha","a","isNaN","convertToPercentage","Number","pad2","c","length","rgbToHsl","r","g","b","h","s","l","d","hue2rgb","p","q","t","rgbToHsv","v","rgbToHex","allow3Char","hex","round","toString","startsWith","charAt","join","rgbaToArgbHex","convertDecimalToHex","convertHexToDecimal","parseIntFromHex","inputToRGB","color","rgb","ok","format","stringInputToObject","isValidCSSUnit","substr","i","floor","f","mod","hsvToRgb","hslToRgb","Object","prototype","hasOwnProperty","call","CSS_UNIT","PERMISSIVE_MATCH3","PERMISSIVE_MATCH4","matchers","RegExp","rgba","hsl","hsla","hsv","hsva","hex3","hex6","hex4","hex8","trim","toLowerCase","named","match","exec","Boolean","TinyColor","constructor","opts","numberInputToObject","this","originalInput","roundA","gradientType","isValid","isDark","getBrightness","isLight","toRgb","getLuminance","R","G","B","RsRGB","GsRGB","BsRGB","pow","getAlpha","setAlpha","alpha","isMonochrome","toHsl","toHsv","toHsvString","toHslString","toHex","toHexString","toHex8","allow4Char","rgbaToHex","toHex8String","toHexShortString","allowShortChar","toRgbString","toPercentageRgb","fmt","x","toPercentageRgbString","rnd","toName","key","value","entries","formatSet","formattedString","hasAlpha","toNumber","clone","lighten","amount","brighten","darken","tint","mix","shade","desaturate","saturate","greyscale","spin","hue","rgb1","rgb2","analogous","results","slices","part","ret","push","complement","monochromatic","res","modification","splitcomplement","onBackground","background","fg","bg","triad","polyad","tetrad","result","increment","equals","getColorInfo","bound","bounds","defineColor","hueRange","Error","randomWithin","range","seed","undefined","random","sMin","lowerBounds","sMax","bMin","bMax","name","saturationRange","brightnessRange","readability","color1","color2","c1","c2","tinycolorumd","mostReadable","baseColor","colorList","args","includeFallbackColors","level","size","bestColor","bestScore","score","wcag2","readabilityLevel","isReadable","options","count","totalColors","colors","colorInput","num","namedColor","find","parsed","getHueRange","pickHue","luminosity","pickSaturation","H","S","s1","v1","s2","v2","m","getMinimumBrightness","pickBrightness","fromRatio","ratio","newColor","legacyRandom","toMsFilter","firstColor","secondColor","hex8String","secondHex8String"],"mappings":"0OAIO,MAAMA,EAAQ,CACjBC,UAAW,UACXC,aAAc,UACdC,KAAM,UACNC,WAAY,UACZC,MAAO,UACPC,MAAO,UACPC,OAAQ,UACRC,MAAO,UACPC,eAAgB,UAChBC,KAAM,UACNC,WAAY,UACZC,MAAO,UACPC,UAAW,UACXC,UAAW,UACXC,WAAY,UACZC,UAAW,UACXC,MAAO,UACPC,eAAgB,UAChBC,SAAU,UACVC,QAAS,UACTC,KAAM,UACNC,SAAU,UACVC,SAAU,UACVC,cAAe,UACfC,SAAU,UACVC,UAAW,UACXC,SAAU,UACVC,UAAW,UACXC,YAAa,UACbC,eAAgB,UAChBC,WAAY,UACZC,WAAY,UACZC,QAAS,UACTC,WAAY,UACZC,aAAc,UACdC,cAAe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