{"version":3,"sources":["webpack:///./node_modules/chroma-js/src/utils/limit.js","webpack:///./node_modules/chroma-js/src/utils/clip_rgb.js","webpack:///./node_modules/chroma-js/src/utils/type.js","webpack:///./node_modules/chroma-js/src/utils/unpack.js","webpack:///./node_modules/chroma-js/src/utils/last.js","webpack:///./node_modules/chroma-js/src/utils/index.js","webpack:///./node_modules/chroma-js/src/io/input.js","webpack:///./node_modules/chroma-js/src/Color.js","webpack:///./node_modules/chroma-js/src/version.js","webpack:///./node_modules/chroma-js/src/chroma.js","webpack:///./node_modules/chroma-js/src/io/cmyk/cmyk2rgb.js","webpack:///./node_modules/chroma-js/src/io/cmyk/rgb2cmyk.js","webpack:///./node_modules/chroma-js/src/io/cmyk/index.js","webpack:///./node_modules/chroma-js/src/io/css/hsl2css.js","webpack:///./node_modules/chroma-js/src/io/hsl/rgb2hsl.js","webpack:///./node_modules/chroma-js/src/io/css/rgb2css.js","webpack:///./node_modules/chroma-js/src/io/hsl/hsl2rgb.js","webpack:///./node_modules/chroma-js/src/io/css/css2rgb.js","webpack:///./node_modules/chroma-js/src/io/css/index.js","webpack:///./node_modules/chroma-js/src/io/gl/index.js","webpack:///./node_modules/chroma-js/src/io/hcg/hcg2rgb.js","webpack:///./node_modules/chroma-js/src/io/hcg/rgb2hcg.js","webpack:///./node_modules/chroma-js/src/io/hcg/index.js","webpack:///./node_modules/chroma-js/src/io/hex/hex2rgb.js","webpack:///./node_modules/chroma-js/src/io/hex/rgb2hex.js","webpack:///./node_modules/chroma-js/src/io/hex/index.js","webpack:///./node_modules/chroma-js/src/io/hsi/hsi2rgb.js","webpack:///./node_modules/chroma-js/src/io/hsi/rgb2hsi.js","webpack:///./node_modules/chroma-js/src/io/hsi/index.js","webpack:///./node_modules/chroma-js/src/io/hsl/index.js","webpack:///./node_modules/chroma-js/src/io/hsv/hsv2rgb.js","webpack:///./node_modules/chroma-js/src/io/hsv/rgb2hsv.js","webpack:///./node_modules/chroma-js/src/io/hsv/index.js","webpack:///./node_modules/chroma-js/src/io/lab/lab-constants.js","webpack:///./node_modules/chroma-js/src/io/lab/lab2rgb.js","webpack:///./node_modules/chroma-js/src/io/lab/rgb2lab.js","webpack:///./node_modules/chroma-js/src/io/lab/index.js","webpack:///./node_modules/chroma-js/src/io/lch/lch2lab.js","webpack:///./node_modules/chroma-js/src/io/lch/lch2rgb.js","webpack:///./node_modules/chroma-js/src/io/lch/hcl2rgb.js","webpack:///./node_modules/chroma-js/src/io/lch/lab2lch.js","webpack:///./node_modules/chroma-js/src/io/lch/rgb2lch.js","webpack:///./node_modules/chroma-js/src/io/lch/index.js","webpack:///./node_modules/chroma-js/src/colors/w3cx11.js","webpack:///./node_modules/chroma-js/src/io/named/index.js","webpack:///./node_modules/chroma-js/src/io/num/num2rgb.js","webpack:///./node_modules/chroma-js/src/io/num/rgb2num.js","webpack:///./node_modules/chroma-js/src/io/num/index.js","webpack:///./node_modules/chroma-js/src/io/rgb/index.js","webpack:///./node_modules/chroma-js/src/io/temp/temperature2rgb.js","webpack:///./node_modules/chroma-js/src/io/temp/rgb2temperature.js","webpack:///./node_modules/chroma-js/src/io/temp/index.js","webpack:///./node_modules/chroma-js/src/io/oklab/oklab2rgb.js","webpack:///./node_modules/chroma-js/src/io/oklab/rgb2oklab.js","webpack:///./node_modules/chroma-js/src/io/oklab/index.js","webpack:///./node_modules/chroma-js/src/io/oklch/oklch2rgb.js","webpack:///./node_modules/chroma-js/src/io/oklch/rgb2oklch.js","webpack:///./node_modules/chroma-js/src/io/oklch/index.js","webpack:///./node_modules/chroma-js/src/ops/alpha.js","webpack:///./node_modules/chroma-js/src/ops/clipped.js","webpack:///./node_modules/chroma-js/src/ops/darken.js","webpack:///./node_modules/chroma-js/src/ops/get.js","webpack:///./node_modules/chroma-js/src/ops/luminance.js","webpack:///./node_modules/chroma-js/src/interpolator/index.js","webpack:///./node_modules/chroma-js/src/generator/mix.js","webpack:///./node_modules/chroma-js/src/ops/mix.js","webpack:///./node_modules/chroma-js/src/ops/premultiply.js","webpack:///./node_modules/chroma-js/src/ops/saturate.js","webpack:///./node_modules/chroma-js/src/ops/set.js","webpack:///./node_modules/chroma-js/src/ops/shade.js","webpack:///./node_modules/chroma-js/src/interpolator/rgb.js","webpack:///./node_modules/chroma-js/src/interpolator/lrgb.js","webpack:///./node_modules/chroma-js/src/interpolator/lab.js","webpack:///./node_modules/chroma-js/src/interpolator/_hsx.js","webpack:///./node_modules/chroma-js/src/interpolator/lch.js","webpack:///./node_modules/chroma-js/src/interpolator/num.js","webpack:///./node_modules/chroma-js/src/interpolator/hcg.js","webpack:///./node_modules/chroma-js/src/interpolator/hsi.js","webpack:///./node_modules/chroma-js/src/interpolator/hsl.js","webpack:///./node_modules/chroma-js/src/interpolator/hsv.js","webpack:///./node_modules/chroma-js/src/interpolator/oklab.js","webpack:///./node_modules/chroma-js/src/interpolator/oklch.js","webpack:///./node_modules/chroma-js/src/generator/average.js","webpack:///./node_modules/chroma-js/src/generator/scale.js","webpack:///./node_modules/chroma-js/src/generator/bezier.js","webpack:///./node_modules/chroma-js/src/generator/blend.js","webpack:///./node_modules/chroma-js/src/generator/cubehelix.js","webpack:///./node_modules/chroma-js/src/generator/random.js","webpack:///./node_modules/chroma-js/src/utils/analyze.js","webpack:///./node_modules/chroma-js/src/utils/contrast.js","webpack:///./node_modules/chroma-js/src/utils/delta-e.js","webpack:///./node_modules/chroma-js/src/utils/distance.js","webpack:///./node_modules/chroma-js/src/utils/valid.js","webpack:///./node_modules/chroma-js/src/utils/scales.js","webpack:///./node_modules/chroma-js/src/colors/colorbrewer.js","webpack:///./node_modules/chroma-js/index.js","webpack:///../../src/util/colors.ts","webpack:///./src/utils/colorPallete.js"],"names":["low","x","high","rgb","_clipped","_unclipped","slice","i","limit","classToType","name","toLowerCase","Object","prototype","toString","call","obj","args","length","Array","type","keyOrder","split","filter","k","undefined","map","l","PI","min","Math","TWOPI","PITHIRD","DEG2RAD","RAD2DEG","format","autodetect","me","this","constructor","mode","last","sorted","sort","a","b","p","chk","test","Error","apply","_rgb","clip_rgb","push","hex","join","version","chroma","Color","cmyk2rgb","unpack","c","m","y","alpha","max","rgb2cmyk","r","g","f","cmyk","input","rnd","round","hsl2css","hsla","rgb2hsl","minRgb","maxRgb","s","h","Number","NaN","rgb2css","rgba","substr","hsl2rgb","t3","t2","t1","h_","RE_RGB","RE_RGBA","RE_RGB_PCT","RE_RGBA_PCT","RE_HSL","RE_HSLA","css2rgb","css","trim","named","e","match","hsl","rest","gl","floor","hcg2rgb","_g","_c","q","t","v","rgb2hcg","delta","hcg","RE_HEX","RE_HEXA","hex2rgb","u","parseInt","rgb2hex","str","hxa","indexOf","cos","hsi2rgb","isNaN","rgb2hsi","min_","sqrt","acos","hsi","hsv2rgb","max_","hsv","rgb2hsv","Kn","Xn","Yn","Zn","t0","pow","lab2rgb","z","b_","lab_xyz","xyz_rgb","rgb2lab","rgb2xyz","rgb_xyz","xyz_lab","lab","sin","lch2lab","lch2rgb","L","hcl2rgb","hcl","reverse","lab2lch","atan2","rgb2lch","lch","forEach","w3cx11","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","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","laserlemon","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrod","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","maroon2","maroon3","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","purple2","purple3","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","n","keys","num2rgb","num","rgb2num","log","temperature2rgb","kelvin","temp","rgb2temperature","minTemp","maxTemp","eps","temperature","oklab2rgb","lrgb2rgb","abs","sign","cbrt","rgb2oklab","lr","lg","lb","rgb2lrgb","oklab","oklch2rgb","rgb2oklch","oklch","mutate","clipped","darken","amount","brighten","darker","brighter","get","mc","channel","src","EPS","MAX_ITER","luminance","lum","cur_lum","max_iter","mid","interpolate","lm","rgb2luminance","luminance_x","interpolator","col1","col2","mix","premultiply","saturate","desaturate","set","value","charAt","out","tint","shade","xyz0","xyz1","lrgb","x1","y1","z1","x2","y2","z2","hue0","hue1","sat0","sat1","lbv0","lbv1","sat","hue","lbv","dh","c1","c2","colors","weights","from","reduce","w","_average_lrgb","first","shift","xyz","cnt","dx","dy","A","ci","xyz2","col","_mode","_nacol","_spread","_domain","_pos","_padding","_classes","_colors","_out","_min","_max","_correctLightness","_colorCache","_useCache","_gamma","setColors","brewer","resetCache","getClass","tMapLightness","tMapDomain","getColor","val","bypassMap","classes","d","analyze","limits","domain","arguments","tOut","tBreaks","every","_m","range","_o","spread","correctLightness","L0","L1","pol","L_actual","L_ideal","L_diff","padding","numColors","result","dm","dd","__range__","samples","end","asc","cache","gamma","nodata","left","right","inclusive","ascending","binom_row","row","newrow","j","bezier","I","lab0","lab1","lab2","lab3","RangeError","labs","sum","el","scale","blend","bottom","top","blend_f","c0","each","normal","multiply","lighten","screen","overlay","burn","dodge","start","rotations","lightness","dl","fract","amp","cos_a","sin_a","digits","code","random","data","key","MAX_VALUE","values","count","min_log","LOG10E","max_log","pb","pr","cluster","assignments","clusterSizes","repeat","nb_iters","centroids","best","mindist","dist","newCentroids","kClusters","tmpKMeansBreaks","l1","l2","rad2deg","rad","deg2rad","deg","a1","b1","L2","a2","b2","avgL","C1","C2","avgC","G","a1p","a2p","C1p","C2p","avgCp","arctan1","arctan2","h1p","h2p","avgHp","T","deltaHp","deltaL","deltaCp","sl","sc","sh","deltaTheta","exp","Rc","Rt","Kl","Kc","Kh","sum_sq","colorbrewer","OrRd","PuBu","BuPu","Oranges","BuGn","YlOrBr","YlGn","Reds","RdPu","Greens","YlGnBu","Purples","GnBu","Greys","YlOrRd","PuRd","Blues","PuBuGn","Viridis","Spectral","RdYlGn","RdBu","PiYG","PRGn","RdYlBu","BrBG","RdGy","PuOr","Set2","Accent","Set1","Set3","Dark2","Paired","Pastel2","Pastel1","assign","average","cubehelix","contrast","deltaE","distance","valid","scales","freeze","base","lighten5","lighten4","lighten3","lighten2","lighten1","darken1","darken2","darken3","darken4","accent1","accent2","accent3","accent4","deepPurple","lightBlue","lightGreen","amber","deepOrange","blueGrey","shades","transparent","shuffle","array","seed","colorArray","entries","flat"],"mappings":"oJAEe,eACJ,EAAI,EAAIA,EAAKC,GAAIC,GCDb,MACXC,EAAIC,UAAW,EACfD,EAAIE,WAAaF,EAAIG,MAAM,GAC3B,IAAK,IAAIC,EAAI,EAAGA,GAAK,EAAGA,IAChBA,EAAI,IACAJ,EAAII,GAAK,GAAKJ,EAAII,GAAK,OAAKJ,EAAIC,UAAW,GAC/CD,EAAII,GAAKC,EAAML,EAAII,GAAI,EAAG,MACb,IAANA,IACPJ,EAAII,GAAKC,EAAML,EAAII,GAAI,EAAG,IAGlC,OAAOJ,GCZX,MAAMM,EAAc,GACpB,IAAK,IAAIC,KAAQ,CACb,UACA,SACA,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AS5nB,OAAOumB,OAAO,CAC3Btc,MAAO,UACP+I,MAAO,UACP6U,YAAa,gBAGA7nB,cAAOumB,OAAO,CAC3B/U,OACAP,QACAG,UACAkW,cACAha,UACAnD,QACAod,aACAzc,QACA4H,QACA1F,SACAwa,cACA1Y,QACAoE,UACAuU,SACAlX,UACAmX,cACArd,SACAsd,YACAza,QACA0a,YC9UF,SAASE,GAAQC,EAAOC,GAEtB,IACE7hB,EACAxG,EAFEuD,EAAI6kB,EAAMznB,OAKd,MAAO4C,EAELvD,EAAIuB,KAAK4E,MAAM4Z,GAAOsI,GAAQ9kB,KAG9BiD,EAAI4hB,EAAM7kB,GACV6kB,EAAM7kB,GAAK6kB,EAAMpoB,GACjBooB,EAAMpoB,GAAKwG,IACT6hB,EAGJ,OAAOD,EAGT,SAASrI,GAAOsI,GACd,IAAI3oB,EAAuB,IAAnB6B,KAAK2H,IAAImf,KACjB,OAAO3oB,EAAI6B,KAAK4E,MAAMzG,GAGxB,MAAM4oB,GAAajoB,OAAOkoB,QAAQ1P,IAC/B7X,OAAO,EAAEif,EAAK9E,KAAgB,UAAP8E,GACvB9e,IAAI,EAAE,CAAEga,KACPjY,GACGqb,MAAM,CAACpD,EAAImM,QAASnM,EAAIiM,QAASjM,EAAI0L,KAAM1L,EAAI8L,WAC/C/K,mBACArD,UAEJ2P,OAEYL,UAAQG,GAAY","file":"js/chunk-2d0c4a27.2146fad2.js","sourcesContent":["import { min, max } from './index.js';\n\nexport default (x, low = 0, high = 1) => {\n return min(max(low, x), high);\n};\n","import limit from './limit.js';\n\nexport default (rgb) => {\n rgb._clipped = false;\n rgb._unclipped = rgb.slice(0);\n for (let i = 0; i <= 3; i++) {\n if (i < 3) {\n if (rgb[i] < 0 || rgb[i] > 255) rgb._clipped = true;\n rgb[i] = limit(rgb[i], 0, 255);\n } else if (i === 3) {\n rgb[i] = limit(rgb[i], 0, 1);\n }\n }\n return rgb;\n};\n","// ported from jQuery's $.type\nconst classToType = {};\nfor (let name of [\n 'Boolean',\n 'Number',\n 'String',\n 'Function',\n 'Array',\n 'Date',\n 'RegExp',\n 'Undefined',\n 'Null'\n]) {\n classToType[`[object ${name}]`] = name.toLowerCase();\n}\nexport default function (obj) {\n return classToType[Object.prototype.toString.call(obj)] || 'object';\n}\n","import type from './type.js';\n\nexport default (args, keyOrder = null) => {\n // if called with more than 3 arguments, we return the arguments\n if (args.length >= 3) return Array.prototype.slice.call(args);\n // with less than 3 args we check if first arg is object\n // and use the keyOrder string to extract and sort properties\n if (type(args[0]) == 'object' && keyOrder) {\n return keyOrder\n .split('')\n .filter((k) => args[0][k] !== undefined)\n .map((k) => args[0][k]);\n }\n // otherwise we just return the first argument\n // (which we suppose is an array of args)\n return args[0];\n};\n","import type from './type.js';\n\nexport default (args) => {\n if (args.length < 2) return null;\n const l = args.length - 1;\n if (type(args[l]) == 'string') return args[l].toLowerCase();\n return null;\n};\n","const { PI, min, max } = Math;\n\nexport { default as clip_rgb } from './clip_rgb.js';\nexport { default as limit } from './limit.js';\nexport { default as type } from './type.js';\nexport { default as unpack } from './unpack.js';\nexport { default as last } from './last.js';\n\nconst TWOPI = PI * 2;\nconst PITHIRD = PI / 3;\nconst DEG2RAD = PI / 180;\nconst RAD2DEG = 180 / PI;\n\nexport { PI, TWOPI, PITHIRD, DEG2RAD, RAD2DEG, min, max };\n","export default {\n format: {},\n autodetect: []\n};\n","import { last, clip_rgb, type } from './utils/index.js';\nimport _input from './io/input.js';\n\nclass Color {\n constructor(...args) {\n const me = this;\n if (\n type(args[0]) === 'object' &&\n args[0].constructor &&\n args[0].constructor === this.constructor\n ) {\n // the argument is already a Color instance\n return args[0];\n }\n // last argument could be the mode\n let mode = last(args);\n let autodetect = false;\n if (!mode) {\n autodetect = true;\n if (!_input.sorted) {\n _input.autodetect = _input.autodetect.sort((a, b) => b.p - a.p);\n _input.sorted = true;\n }\n // auto-detect format\n for (let chk of _input.autodetect) {\n mode = chk.test(...args);\n if (mode) break;\n }\n }\n if (_input.format[mode]) {\n const rgb = _input.format[mode].apply(\n null,\n autodetect ? args : args.slice(0, -1)\n );\n me._rgb = clip_rgb(rgb);\n } else {\n throw new Error('unknown format: ' + args);\n }\n // add alpha channel\n if (me._rgb.length === 3) me._rgb.push(1);\n }\n toString() {\n if (type(this.hex) == 'function') return this.hex();\n return `[${this._rgb.join(',')}]`;\n }\n}\nexport default Color;\n","// this gets updated automatically\nexport const version = '2.6.0';\n","import Color from './Color.js';\nimport { version } from './version.js';\n\nconst chroma = (...args) => {\n return new chroma.Color(...args);\n};\n\nchroma.Color = Color;\nchroma.version = version;\n\nexport default chroma;\n","import { unpack } from '../../utils/index.js';\n\nconst cmyk2rgb = (...args) => {\n args = unpack(args, 'cmyk');\n const [c, m, y, k] = args;\n const alpha = args.length > 4 ? args[4] : 1;\n if (k === 1) return [0, 0, 0, alpha];\n return [\n c >= 1 ? 0 : 255 * (1 - c) * (1 - k), // r\n m >= 1 ? 0 : 255 * (1 - m) * (1 - k), // g\n y >= 1 ? 0 : 255 * (1 - y) * (1 - k), // b\n alpha\n ];\n};\n\nexport default cmyk2rgb;\n","import { unpack } from '../../utils/index.js';\nconst { max } = Math;\n\nconst rgb2cmyk = (...args) => {\n let [r, g, b] = unpack(args, 'rgb');\n r = r / 255;\n g = g / 255;\n b = b / 255;\n const k = 1 - max(r, max(g, b));\n const f = k < 1 ? 1 / (1 - k) : 0;\n const c = (1 - r - k) * f;\n const m = (1 - g - k) * f;\n const y = (1 - b - k) * f;\n return [c, m, y, k];\n};\n\nexport default rgb2cmyk;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { unpack, type } from '../../utils/index.js';\nimport cmyk2rgb from './cmyk2rgb.js';\nimport rgb2cmyk from './rgb2cmyk.js';\n\nColor.prototype.cmyk = function () {\n return rgb2cmyk(this._rgb);\n};\n\nchroma.cmyk = (...args) => new Color(...args, 'cmyk');\n\ninput.format.cmyk = cmyk2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'cmyk');\n if (type(args) === 'array' && args.length === 4) {\n return 'cmyk';\n }\n }\n});\n","import { unpack, last } from '../../utils/index.js';\nconst rnd = (a) => Math.round(a * 100) / 100;\n\n/*\n * supported arguments:\n * - hsl2css(h,s,l)\n * - hsl2css(h,s,l,a)\n * - hsl2css([h,s,l], mode)\n * - hsl2css([h,s,l,a], mode)\n * - hsl2css({h,s,l,a}, mode)\n */\nconst hsl2css = (...args) => {\n const hsla = unpack(args, 'hsla');\n let mode = last(args) || 'lsa';\n hsla[0] = rnd(hsla[0] || 0);\n hsla[1] = rnd(hsla[1] * 100) + '%';\n hsla[2] = rnd(hsla[2] * 100) + '%';\n if (mode === 'hsla' || (hsla.length > 3 && hsla[3] < 1)) {\n hsla[3] = hsla.length > 3 ? hsla[3] : 1;\n mode = 'hsla';\n } else {\n hsla.length = 3;\n }\n return `${mode}(${hsla.join(',')})`;\n};\n\nexport default hsl2css;\n","import { unpack, min, max } from '../../utils/index.js';\n\n/*\n * supported arguments:\n * - rgb2hsl(r,g,b)\n * - rgb2hsl(r,g,b,a)\n * - rgb2hsl([r,g,b])\n * - rgb2hsl([r,g,b,a])\n * - rgb2hsl({r,g,b,a})\n */\nconst rgb2hsl = (...args) => {\n args = unpack(args, 'rgba');\n let [r, g, b] = args;\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n const minRgb = min(r, g, b);\n const maxRgb = max(r, g, b);\n\n const l = (maxRgb + minRgb) / 2;\n let s, h;\n\n if (maxRgb === minRgb) {\n s = 0;\n h = Number.NaN;\n } else {\n s =\n l < 0.5\n ? (maxRgb - minRgb) / (maxRgb + minRgb)\n : (maxRgb - minRgb) / (2 - maxRgb - minRgb);\n }\n\n if (r == maxRgb) h = (g - b) / (maxRgb - minRgb);\n else if (g == maxRgb) h = 2 + (b - r) / (maxRgb - minRgb);\n else if (b == maxRgb) h = 4 + (r - g) / (maxRgb - minRgb);\n\n h *= 60;\n if (h < 0) h += 360;\n if (args.length > 3 && args[3] !== undefined) return [h, s, l, args[3]];\n return [h, s, l];\n};\n\nexport default rgb2hsl;\n","import { unpack, last } from '../../utils/index.js';\nimport hsl2css from './hsl2css.js';\nimport rgb2hsl from '../hsl/rgb2hsl.js';\nconst { round } = Math;\n\n/*\n * supported arguments:\n * - rgb2css(r,g,b)\n * - rgb2css(r,g,b,a)\n * - rgb2css([r,g,b], mode)\n * - rgb2css([r,g,b,a], mode)\n * - rgb2css({r,g,b,a}, mode)\n */\nconst rgb2css = (...args) => {\n const rgba = unpack(args, 'rgba');\n let mode = last(args) || 'rgb';\n if (mode.substr(0, 3) == 'hsl') {\n return hsl2css(rgb2hsl(rgba), mode);\n }\n rgba[0] = round(rgba[0]);\n rgba[1] = round(rgba[1]);\n rgba[2] = round(rgba[2]);\n if (mode === 'rgba' || (rgba.length > 3 && rgba[3] < 1)) {\n rgba[3] = rgba.length > 3 ? rgba[3] : 1;\n mode = 'rgba';\n }\n return `${mode}(${rgba.slice(0, mode === 'rgb' ? 3 : 4).join(',')})`;\n};\n\nexport default rgb2css;\n","import { unpack } from '../../utils/index.js';\nconst { round } = Math;\n\nconst hsl2rgb = (...args) => {\n args = unpack(args, 'hsl');\n const [h, s, l] = args;\n let r, g, b;\n if (s === 0) {\n r = g = b = l * 255;\n } else {\n const t3 = [0, 0, 0];\n const c = [0, 0, 0];\n const t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const t1 = 2 * l - t2;\n const h_ = h / 360;\n t3[0] = h_ + 1 / 3;\n t3[1] = h_;\n t3[2] = h_ - 1 / 3;\n for (let i = 0; i < 3; i++) {\n if (t3[i] < 0) t3[i] += 1;\n if (t3[i] > 1) t3[i] -= 1;\n if (6 * t3[i] < 1) c[i] = t1 + (t2 - t1) * 6 * t3[i];\n else if (2 * t3[i] < 1) c[i] = t2;\n else if (3 * t3[i] < 2) c[i] = t1 + (t2 - t1) * (2 / 3 - t3[i]) * 6;\n else c[i] = t1;\n }\n [r, g, b] = [round(c[0] * 255), round(c[1] * 255), round(c[2] * 255)];\n }\n if (args.length > 3) {\n // keep alpha channel\n return [r, g, b, args[3]];\n }\n return [r, g, b, 1];\n};\n\nexport default hsl2rgb;\n","import hsl2rgb from '../hsl/hsl2rgb.js';\nimport input from '../input.js';\n\nconst RE_RGB = /^rgb\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*\\)$/;\nconst RE_RGBA =\n /^rgba\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\nconst RE_RGB_PCT =\n /^rgb\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\nconst RE_RGBA_PCT =\n /^rgba\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\nconst RE_HSL =\n /^hsl\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\nconst RE_HSLA =\n /^hsla\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n\nconst { round } = Math;\n\nconst css2rgb = (css) => {\n css = css.toLowerCase().trim();\n let m;\n\n if (input.format.named) {\n try {\n return input.format.named(css);\n // eslint-disable-next-line\n } catch (e) {}\n }\n\n // rgb(250,20,0)\n if ((m = css.match(RE_RGB))) {\n const rgb = m.slice(1, 4);\n for (let i = 0; i < 3; i++) {\n rgb[i] = +rgb[i];\n }\n rgb[3] = 1; // default alpha\n return rgb;\n }\n\n // rgba(250,20,0,0.4)\n if ((m = css.match(RE_RGBA))) {\n const rgb = m.slice(1, 5);\n for (let i = 0; i < 4; i++) {\n rgb[i] = +rgb[i];\n }\n return rgb;\n }\n\n // rgb(100%,0%,0%)\n if ((m = css.match(RE_RGB_PCT))) {\n const rgb = m.slice(1, 4);\n for (let i = 0; i < 3; i++) {\n rgb[i] = round(rgb[i] * 2.55);\n }\n rgb[3] = 1; // default alpha\n return rgb;\n }\n\n // rgba(100%,0%,0%,0.4)\n if ((m = css.match(RE_RGBA_PCT))) {\n const rgb = m.slice(1, 5);\n for (let i = 0; i < 3; i++) {\n rgb[i] = round(rgb[i] * 2.55);\n }\n rgb[3] = +rgb[3];\n return rgb;\n }\n\n // hsl(0,100%,50%)\n if ((m = css.match(RE_HSL))) {\n const hsl = m.slice(1, 4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n const rgb = hsl2rgb(hsl);\n rgb[3] = 1;\n return rgb;\n }\n\n // hsla(0,100%,50%,0.5)\n if ((m = css.match(RE_HSLA))) {\n const hsl = m.slice(1, 4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n const rgb = hsl2rgb(hsl);\n rgb[3] = +m[4]; // default alpha = 1\n return rgb;\n }\n};\n\ncss2rgb.test = (s) => {\n return (\n RE_RGB.test(s) ||\n RE_RGBA.test(s) ||\n RE_RGB_PCT.test(s) ||\n RE_RGBA_PCT.test(s) ||\n RE_HSL.test(s) ||\n RE_HSLA.test(s)\n );\n};\n\nexport default css2rgb;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { type } from '../../utils/index.js';\n\nimport rgb2css from './rgb2css.js';\nimport css2rgb from './css2rgb.js';\n\nColor.prototype.css = function (mode) {\n return rgb2css(this._rgb, mode);\n};\n\nchroma.css = (...args) => new Color(...args, 'css');\n\ninput.format.css = css2rgb;\n\ninput.autodetect.push({\n p: 5,\n test: (h, ...rest) => {\n if (!rest.length && type(h) === 'string' && css2rgb.test(h)) {\n return 'css';\n }\n }\n});\n","import Color from '../../Color.js';\nimport chroma from '../../chroma.js';\nimport input from '../input.js';\nimport { unpack } from '../../utils/index.js';\n\ninput.format.gl = (...args) => {\n const rgb = unpack(args, 'rgba');\n rgb[0] *= 255;\n rgb[1] *= 255;\n rgb[2] *= 255;\n return rgb;\n};\n\nchroma.gl = (...args) => new Color(...args, 'gl');\n\nColor.prototype.gl = function () {\n const rgb = this._rgb;\n return [rgb[0] / 255, rgb[1] / 255, rgb[2] / 255, rgb[3]];\n};\n","import { unpack } from '../../utils/index.js';\nconst { floor } = Math;\n\n/*\n * this is basically just HSV with some minor tweaks\n *\n * hue.. [0..360]\n * chroma .. [0..1]\n * grayness .. [0..1]\n */\n\nconst hcg2rgb = (...args) => {\n args = unpack(args, 'hcg');\n let [h, c, _g] = args;\n let r, g, b;\n _g = _g * 255;\n const _c = c * 255;\n if (c === 0) {\n r = g = b = _g;\n } else {\n if (h === 360) h = 0;\n if (h > 360) h -= 360;\n if (h < 0) h += 360;\n h /= 60;\n const i = floor(h);\n const f = h - i;\n const p = _g * (1 - c);\n const q = p + _c * (1 - f);\n const t = p + _c * f;\n const v = p + _c;\n switch (i) {\n case 0:\n [r, g, b] = [v, t, p];\n break;\n case 1:\n [r, g, b] = [q, v, p];\n break;\n case 2:\n [r, g, b] = [p, v, t];\n break;\n case 3:\n [r, g, b] = [p, q, v];\n break;\n case 4:\n [r, g, b] = [t, p, v];\n break;\n case 5:\n [r, g, b] = [v, p, q];\n break;\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n};\n\nexport default hcg2rgb;\n","import { unpack, max, min } from '../../utils/index.js';\n\nconst rgb2hcg = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n const minRgb = min(r, g, b);\n const maxRgb = max(r, g, b);\n const delta = maxRgb - minRgb;\n const c = (delta * 100) / 255;\n const _g = (minRgb / (255 - delta)) * 100;\n let h;\n if (delta === 0) {\n h = Number.NaN;\n } else {\n if (r === maxRgb) h = (g - b) / delta;\n if (g === maxRgb) h = 2 + (b - r) / delta;\n if (b === maxRgb) h = 4 + (r - g) / delta;\n h *= 60;\n if (h < 0) h += 360;\n }\n return [h, c, _g];\n};\n\nexport default rgb2hcg;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport hcg2rgb from './hcg2rgb.js';\nimport rgb2hcg from './rgb2hcg.js';\n\nColor.prototype.hcg = function () {\n return rgb2hcg(this._rgb);\n};\n\nchroma.hcg = (...args) => new Color(...args, 'hcg');\n\ninput.format.hcg = hcg2rgb;\n\ninput.autodetect.push({\n p: 1,\n test: (...args) => {\n args = unpack(args, 'hcg');\n if (type(args) === 'array' && args.length === 3) {\n return 'hcg';\n }\n }\n});\n","const RE_HEX = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;\nconst RE_HEXA = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;\n\nconst hex2rgb = (hex) => {\n if (hex.match(RE_HEX)) {\n // remove optional leading #\n if (hex.length === 4 || hex.length === 7) {\n hex = hex.substr(1);\n }\n // expand short-notation to full six-digit\n if (hex.length === 3) {\n hex = hex.split('');\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n const u = parseInt(hex, 16);\n const r = u >> 16;\n const g = (u >> 8) & 0xff;\n const b = u & 0xff;\n return [r, g, b, 1];\n }\n\n // match rgba hex format, eg #FF000077\n if (hex.match(RE_HEXA)) {\n if (hex.length === 5 || hex.length === 9) {\n // remove optional leading #\n hex = hex.substr(1);\n }\n // expand short-notation to full eight-digit\n if (hex.length === 4) {\n hex = hex.split('');\n hex =\n hex[0] +\n hex[0] +\n hex[1] +\n hex[1] +\n hex[2] +\n hex[2] +\n hex[3] +\n hex[3];\n }\n const u = parseInt(hex, 16);\n const r = (u >> 24) & 0xff;\n const g = (u >> 16) & 0xff;\n const b = (u >> 8) & 0xff;\n const a = Math.round(((u & 0xff) / 0xff) * 100) / 100;\n return [r, g, b, a];\n }\n\n // we used to check for css colors here\n // if _input.css? and rgb = _input.css hex\n // return rgb\n\n throw new Error(`unknown hex color: ${hex}`);\n};\n\nexport default hex2rgb;\n","import { unpack, last } from '../../utils/index.js';\nconst { round } = Math;\n\nconst rgb2hex = (...args) => {\n let [r, g, b, a] = unpack(args, 'rgba');\n let mode = last(args) || 'auto';\n if (a === undefined) a = 1;\n if (mode === 'auto') {\n mode = a < 1 ? 'rgba' : 'rgb';\n }\n r = round(r);\n g = round(g);\n b = round(b);\n const u = (r << 16) | (g << 8) | b;\n let str = '000000' + u.toString(16); //#.toUpperCase();\n str = str.substr(str.length - 6);\n let hxa = '0' + round(a * 255).toString(16);\n hxa = hxa.substr(hxa.length - 2);\n switch (mode.toLowerCase()) {\n case 'rgba':\n return `#${str}${hxa}`;\n case 'argb':\n return `#${hxa}${str}`;\n default:\n return `#${str}`;\n }\n};\n\nexport default rgb2hex;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport { type } from '../../utils/index.js';\nimport input from '../input.js';\nimport hex2rgb from './hex2rgb.js';\nimport rgb2hex from './rgb2hex.js';\n\nColor.prototype.hex = function (mode) {\n return rgb2hex(this._rgb, mode);\n};\n\nchroma.hex = (...args) => new Color(...args, 'hex');\n\ninput.format.hex = hex2rgb;\ninput.autodetect.push({\n p: 4,\n test: (h, ...rest) => {\n if (\n !rest.length &&\n type(h) === 'string' &&\n [3, 4, 5, 6, 7, 8, 9].indexOf(h.length) >= 0\n ) {\n return 'hex';\n }\n }\n});\n","import { unpack, limit, TWOPI, PITHIRD } from '../../utils/index.js';\nconst { cos } = Math;\n\n/*\n * hue [0..360]\n * saturation [0..1]\n * intensity [0..1]\n */\nconst hsi2rgb = (...args) => {\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp\n */\n args = unpack(args, 'hsi');\n let [h, s, i] = args;\n let r, g, b;\n\n if (isNaN(h)) h = 0;\n if (isNaN(s)) s = 0;\n // normalize hue\n if (h > 360) h -= 360;\n if (h < 0) h += 360;\n h /= 360;\n if (h < 1 / 3) {\n b = (1 - s) / 3;\n r = (1 + (s * cos(TWOPI * h)) / cos(PITHIRD - TWOPI * h)) / 3;\n g = 1 - (b + r);\n } else if (h < 2 / 3) {\n h -= 1 / 3;\n r = (1 - s) / 3;\n g = (1 + (s * cos(TWOPI * h)) / cos(PITHIRD - TWOPI * h)) / 3;\n b = 1 - (r + g);\n } else {\n h -= 2 / 3;\n g = (1 - s) / 3;\n b = (1 + (s * cos(TWOPI * h)) / cos(PITHIRD - TWOPI * h)) / 3;\n r = 1 - (g + b);\n }\n r = limit(i * r * 3);\n g = limit(i * g * 3);\n b = limit(i * b * 3);\n return [r * 255, g * 255, b * 255, args.length > 3 ? args[3] : 1];\n};\n\nexport default hsi2rgb;\n","import { unpack, TWOPI } from '../../utils/index.js';\nconst { min, sqrt, acos } = Math;\n\nconst rgb2hsi = (...args) => {\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp\n */\n let [r, g, b] = unpack(args, 'rgb');\n r /= 255;\n g /= 255;\n b /= 255;\n let h;\n const min_ = min(r, g, b);\n const i = (r + g + b) / 3;\n const s = i > 0 ? 1 - min_ / i : 0;\n if (s === 0) {\n h = NaN;\n } else {\n h = (r - g + (r - b)) / 2;\n h /= sqrt((r - g) * (r - g) + (r - b) * (g - b));\n h = acos(h);\n if (b > g) {\n h = TWOPI - h;\n }\n h /= TWOPI;\n }\n return [h * 360, s, i];\n};\n\nexport default rgb2hsi;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport hsi2rgb from './hsi2rgb.js';\nimport rgb2hsi from './rgb2hsi.js';\n\nColor.prototype.hsi = function () {\n return rgb2hsi(this._rgb);\n};\n\nchroma.hsi = (...args) => new Color(...args, 'hsi');\n\ninput.format.hsi = hsi2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'hsi');\n if (type(args) === 'array' && args.length === 3) {\n return 'hsi';\n }\n }\n});\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport hsl2rgb from './hsl2rgb.js';\nimport rgb2hsl from './rgb2hsl.js';\n\nColor.prototype.hsl = function () {\n return rgb2hsl(this._rgb);\n};\n\nchroma.hsl = (...args) => new Color(...args, 'hsl');\n\ninput.format.hsl = hsl2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'hsl');\n if (type(args) === 'array' && args.length === 3) {\n return 'hsl';\n }\n }\n});\n","import { unpack } from '../../utils/index.js';\nconst { floor } = Math;\n\nconst hsv2rgb = (...args) => {\n args = unpack(args, 'hsv');\n let [h, s, v] = args;\n let r, g, b;\n v *= 255;\n if (s === 0) {\n r = g = b = v;\n } else {\n if (h === 360) h = 0;\n if (h > 360) h -= 360;\n if (h < 0) h += 360;\n h /= 60;\n\n const i = floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - s * f);\n const t = v * (1 - s * (1 - f));\n\n switch (i) {\n case 0:\n [r, g, b] = [v, t, p];\n break;\n case 1:\n [r, g, b] = [q, v, p];\n break;\n case 2:\n [r, g, b] = [p, v, t];\n break;\n case 3:\n [r, g, b] = [p, q, v];\n break;\n case 4:\n [r, g, b] = [t, p, v];\n break;\n case 5:\n [r, g, b] = [v, p, q];\n break;\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n};\n\nexport default hsv2rgb;\n","import { unpack } from '../../utils/index.js';\nconst { min, max } = Math;\n\n/*\n * supported arguments:\n * - rgb2hsv(r,g,b)\n * - rgb2hsv([r,g,b])\n * - rgb2hsv({r,g,b})\n */\nconst rgb2hsl = (...args) => {\n args = unpack(args, 'rgb');\n let [r, g, b] = args;\n const min_ = min(r, g, b);\n const max_ = max(r, g, b);\n const delta = max_ - min_;\n let h, s, v;\n v = max_ / 255.0;\n if (max_ === 0) {\n h = Number.NaN;\n s = 0;\n } else {\n s = delta / max_;\n if (r === max_) h = (g - b) / delta;\n if (g === max_) h = 2 + (b - r) / delta;\n if (b === max_) h = 4 + (r - g) / delta;\n h *= 60;\n if (h < 0) h += 360;\n }\n return [h, s, v];\n};\n\nexport default rgb2hsl;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport hsv2rgb from './hsv2rgb.js';\nimport rgb2hsv from './rgb2hsv.js';\n\nColor.prototype.hsv = function () {\n return rgb2hsv(this._rgb);\n};\n\nchroma.hsv = (...args) => new Color(...args, 'hsv');\n\ninput.format.hsv = hsv2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'hsv');\n if (type(args) === 'array' && args.length === 3) {\n return 'hsv';\n }\n }\n});\n","export default {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n\n // D65 standard referent\n Xn: 0.95047,\n Yn: 1,\n Zn: 1.08883,\n\n t0: 0.137931034, // 4 / 29\n t1: 0.206896552, // 6 / 29\n t2: 0.12841855, // 3 * t1 * t1\n t3: 0.008856452 // t1 * t1 * t1\n};\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\nconst { pow } = Math;\n\n/*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\nconst lab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [l, a, b] = args;\n let x, y, z, r, g, b_;\n\n y = (l + 16) / 116;\n x = isNaN(a) ? y : y + a / 500;\n z = isNaN(b) ? y : y - b / 200;\n\n y = LAB_CONSTANTS.Yn * lab_xyz(y);\n x = LAB_CONSTANTS.Xn * lab_xyz(x);\n z = LAB_CONSTANTS.Zn * lab_xyz(z);\n\n r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z); // D65 -> sRGB\n g = xyz_rgb(-0.969266 * x + 1.8760108 * y + 0.041556 * z);\n b_ = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);\n\n return [r, g, b_, args.length > 3 ? args[3] : 1];\n};\n\nconst xyz_rgb = (r) => {\n return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow(r, 1 / 2.4) - 0.055);\n};\n\nconst lab_xyz = (t) => {\n return t > LAB_CONSTANTS.t1\n ? t * t * t\n : LAB_CONSTANTS.t2 * (t - LAB_CONSTANTS.t0);\n};\n\nexport default lab2rgb;\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\nconst { pow } = Math;\n\nconst rgb2lab = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n const [x, y, z] = rgb2xyz(r, g, b);\n const l = 116 * y - 16;\n return [l < 0 ? 0 : l, 500 * (x - y), 200 * (y - z)];\n};\n\nconst rgb_xyz = (r) => {\n if ((r /= 255) <= 0.04045) return r / 12.92;\n return pow((r + 0.055) / 1.055, 2.4);\n};\n\nconst xyz_lab = (t) => {\n if (t > LAB_CONSTANTS.t3) return pow(t, 1 / 3);\n return t / LAB_CONSTANTS.t2 + LAB_CONSTANTS.t0;\n};\n\nconst rgb2xyz = (r, g, b) => {\n r = rgb_xyz(r);\n g = rgb_xyz(g);\n b = rgb_xyz(b);\n const x = xyz_lab(\n (0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS.Xn\n );\n const y = xyz_lab(\n (0.2126729 * r + 0.7151522 * g + 0.072175 * b) / LAB_CONSTANTS.Yn\n );\n const z = xyz_lab(\n (0.0193339 * r + 0.119192 * g + 0.9503041 * b) / LAB_CONSTANTS.Zn\n );\n return [x, y, z];\n};\n\nexport default rgb2lab;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport lab2rgb from './lab2rgb.js';\nimport rgb2lab from './rgb2lab.js';\n\nColor.prototype.lab = function () {\n return rgb2lab(this._rgb);\n};\n\nchroma.lab = (...args) => new Color(...args, 'lab');\n\ninput.format.lab = lab2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'lab');\n if (type(args) === 'array' && args.length === 3) {\n return 'lab';\n }\n }\n});\n","import { unpack, DEG2RAD } from '../../utils/index.js';\nconst { sin, cos } = Math;\n\nconst lch2lab = (...args) => {\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n\n A saturation multiplier was added by Gregor Aisch\n */\n let [l, c, h] = unpack(args, 'lch');\n if (isNaN(h)) h = 0;\n h = h * DEG2RAD;\n return [l, cos(h) * c, sin(h) * c];\n};\n\nexport default lch2lab;\n","import { unpack } from '../../utils/index.js';\nimport lch2lab from './lch2lab.js';\nimport lab2rgb from '../lab/lab2rgb.js';\n\nconst lch2rgb = (...args) => {\n args = unpack(args, 'lch');\n const [l, c, h] = args;\n const [L, a, b_] = lch2lab(l, c, h);\n const [r, g, b] = lab2rgb(L, a, b_);\n return [r, g, b, args.length > 3 ? args[3] : 1];\n};\n\nexport default lch2rgb;\n","import { unpack } from '../../utils/index.js';\nimport lch2rgb from './lch2rgb.js';\n\nconst hcl2rgb = (...args) => {\n const hcl = unpack(args, 'hcl').reverse();\n return lch2rgb(...hcl);\n};\n\nexport default hcl2rgb;\n","import { unpack, RAD2DEG } from '../../utils/index.js';\nconst { sqrt, atan2, round } = Math;\n\nconst lab2lch = (...args) => {\n const [l, a, b] = unpack(args, 'lab');\n const c = sqrt(a * a + b * b);\n let h = (atan2(b, a) * RAD2DEG + 360) % 360;\n if (round(c * 10000) === 0) h = Number.NaN;\n return [l, c, h];\n};\n\nexport default lab2lch;\n","import { unpack } from '../../utils/index.js';\nimport rgb2lab from '../lab/rgb2lab.js';\nimport lab2lch from './lab2lch.js';\n\nconst rgb2lch = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2lab(r, g, b);\n return lab2lch(l, a, b_);\n};\n\nexport default rgb2lch;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport lch2rgb from './lch2rgb.js';\nimport hcl2rgb from './hcl2rgb.js';\nimport rgb2lch from './rgb2lch.js';\n\nColor.prototype.lch = function () {\n return rgb2lch(this._rgb);\n};\nColor.prototype.hcl = function () {\n return rgb2lch(this._rgb).reverse();\n};\n\nchroma.lch = (...args) => new Color(...args, 'lch');\nchroma.hcl = (...args) => new Color(...args, 'hcl');\n\ninput.format.lch = lch2rgb;\ninput.format.hcl = hcl2rgb;\n['lch', 'hcl'].forEach((m) =>\n input.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, m);\n if (type(args) === 'array' && args.length === 3) {\n return m;\n }\n }\n })\n);\n","/**\n\tX11 color names\n\n\thttp://www.w3.org/TR/css3-color/#svg-color\n*/\n\nconst w3cx11 = {\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 gold: '#ffd700',\n goldenrod: '#daa520',\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 laserlemon: '#ffff54',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrod: '#fafad2',\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 maroon2: '#7f0000',\n maroon3: '#b03060',\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 purple2: '#7f007f',\n purple3: '#a020f0',\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\nexport default w3cx11;\n","import Color from '../../Color.js';\nimport input from '../input.js';\nimport { type } from '../../utils/index.js';\n\nimport w3cx11 from '../../colors/w3cx11.js';\nimport hex2rgb from '../hex/hex2rgb.js';\nimport rgb2hex from '../hex/rgb2hex.js';\n\nColor.prototype.name = function () {\n const hex = rgb2hex(this._rgb, 'rgb');\n for (let n of Object.keys(w3cx11)) {\n if (w3cx11[n] === hex) return n.toLowerCase();\n }\n return hex;\n};\n\ninput.format.named = (name) => {\n name = name.toLowerCase();\n if (w3cx11[name]) return hex2rgb(w3cx11[name]);\n throw new Error('unknown color name: ' + name);\n};\n\ninput.autodetect.push({\n p: 5,\n test: (h, ...rest) => {\n if (!rest.length && type(h) === 'string' && w3cx11[h.toLowerCase()]) {\n return 'named';\n }\n }\n});\n","import { type } from '../../utils/index.js';\n\nconst num2rgb = (num) => {\n if (type(num) == 'number' && num >= 0 && num <= 0xffffff) {\n const r = num >> 16;\n const g = (num >> 8) & 0xff;\n const b = num & 0xff;\n return [r, g, b, 1];\n }\n throw new Error('unknown num color: ' + num);\n};\n\nexport default num2rgb;\n","import { unpack } from '../../utils/index.js';\n\nconst rgb2num = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n return (r << 16) + (g << 8) + b;\n};\n\nexport default rgb2num;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { type } from '../../utils/index.js';\nimport num2rgb from './num2rgb.js';\nimport rgb2num from './rgb2num.js';\n\nColor.prototype.num = function () {\n return rgb2num(this._rgb);\n};\n\nchroma.num = (...args) => new Color(...args, 'num');\n\ninput.format.num = num2rgb;\n\ninput.autodetect.push({\n p: 5,\n test: (...args) => {\n if (\n args.length === 1 &&\n type(args[0]) === 'number' &&\n args[0] >= 0 &&\n args[0] <= 0xffffff\n ) {\n return 'num';\n }\n }\n});\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { unpack, type } from '../../utils/index.js';\nconst { round } = Math;\n\nColor.prototype.rgb = function (rnd = true) {\n if (rnd === false) return this._rgb.slice(0, 3);\n return this._rgb.slice(0, 3).map(round);\n};\n\nColor.prototype.rgba = function (rnd = true) {\n return this._rgb.slice(0, 4).map((v, i) => {\n return i < 3 ? (rnd === false ? v : round(v)) : v;\n });\n};\n\nchroma.rgb = (...args) => new Color(...args, 'rgb');\n\ninput.format.rgb = (...args) => {\n const rgba = unpack(args, 'rgba');\n if (rgba[3] === undefined) rgba[3] = 1;\n return rgba;\n};\n\ninput.autodetect.push({\n p: 3,\n test: (...args) => {\n args = unpack(args, 'rgba');\n if (\n type(args) === 'array' &&\n (args.length === 3 ||\n (args.length === 4 &&\n type(args[3]) == 'number' &&\n args[3] >= 0 &&\n args[3] <= 1))\n ) {\n return 'rgb';\n }\n }\n});\n","/*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n */\n\nconst { log } = Math;\n\nconst temperature2rgb = (kelvin) => {\n const temp = kelvin / 100;\n let r, g, b;\n if (temp < 66) {\n r = 255;\n g =\n temp < 6\n ? 0\n : -155.25485562709179 -\n 0.44596950469579133 * (g = temp - 2) +\n 104.49216199393888 * log(g);\n b =\n temp < 20\n ? 0\n : -254.76935184120902 +\n 0.8274096064007395 * (b = temp - 10) +\n 115.67994401066147 * log(b);\n } else {\n r =\n 351.97690566805693 +\n 0.114206453784165 * (r = temp - 55) -\n 40.25366309332127 * log(r);\n g =\n 325.4494125711974 +\n 0.07943456536662342 * (g = temp - 50) -\n 28.0852963507957 * log(g);\n b = 255;\n }\n return [r, g, b, 1];\n};\n\nexport default temperature2rgb;\n","/*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n **/\n\nimport temperature2rgb from './temperature2rgb.js';\nimport { unpack } from '../../utils/index.js';\nconst { round } = Math;\n\nconst rgb2temperature = (...args) => {\n const rgb = unpack(args, 'rgb');\n const r = rgb[0],\n b = rgb[2];\n let minTemp = 1000;\n let maxTemp = 40000;\n const eps = 0.4;\n let temp;\n while (maxTemp - minTemp > eps) {\n temp = (maxTemp + minTemp) * 0.5;\n const rgb = temperature2rgb(temp);\n if (rgb[2] / rgb[0] >= b / r) {\n maxTemp = temp;\n } else {\n minTemp = temp;\n }\n }\n return round(temp);\n};\n\nexport default rgb2temperature;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport temperature2rgb from './temperature2rgb.js';\nimport rgb2temperature from './rgb2temperature.js';\n\nColor.prototype.temp =\n Color.prototype.kelvin =\n Color.prototype.temperature =\n function () {\n return rgb2temperature(this._rgb);\n };\n\nchroma.temp =\n chroma.kelvin =\n chroma.temperature =\n (...args) => new Color(...args, 'temp');\n\ninput.format.temp =\n input.format.kelvin =\n input.format.temperature =\n temperature2rgb;\n","import { unpack } from '../../utils/index.js';\nconst { pow, sign } = Math;\n\n/*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\nconst oklab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b] = args;\n\n const l = pow(L + 0.3963377774 * a + 0.2158037573 * b, 3);\n const m = pow(L - 0.1055613458 * a - 0.0638541728 * b, 3);\n const s = pow(L - 0.0894841775 * a - 1.291485548 * b, 3);\n\n return [\n 255 * lrgb2rgb(+4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n 255 * lrgb2rgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n 255 * lrgb2rgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),\n args.length > 3 ? args[3] : 1\n ];\n};\n\nexport default oklab2rgb;\n\nfunction lrgb2rgb(c) {\n const abs = Math.abs(c);\n if (abs > 0.0031308) {\n return (sign(c) || 1) * (1.055 * pow(abs, 1 / 2.4) - 0.055);\n }\n return c * 12.92;\n}\n","import { unpack } from '../../utils/index.js';\nconst { cbrt, pow, sign } = Math;\n\nconst rgb2oklab = (...args) => {\n // OKLab color space implementation taken from\n // https://bottosson.github.io/posts/oklab/\n const [r, g, b] = unpack(args, 'rgb');\n const [lr, lg, lb] = [\n rgb2lrgb(r / 255),\n rgb2lrgb(g / 255),\n rgb2lrgb(b / 255)\n ];\n const l = cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);\n const m = cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);\n const s = cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);\n\n return [\n 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s\n ];\n};\n\nexport default rgb2oklab;\n\nfunction rgb2lrgb(c) {\n const abs = Math.abs(c);\n if (abs < 0.04045) {\n return c / 12.92;\n }\n return (sign(c) || 1) * pow((abs + 0.055) / 1.055, 2.4);\n}\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport oklab2rgb from './oklab2rgb.js';\nimport rgb2oklab from './rgb2oklab.js';\n\nColor.prototype.oklab = function () {\n return rgb2oklab(this._rgb);\n};\n\nchroma.oklab = (...args) => new Color(...args, 'oklab');\n\ninput.format.oklab = oklab2rgb;\n\ninput.autodetect.push({\n p: 3,\n test: (...args) => {\n args = unpack(args, 'oklab');\n if (type(args) === 'array' && args.length === 3) {\n return 'oklab';\n }\n }\n});\n","import { unpack } from '../../utils/index.js';\nimport lch2lab from '../lch/lch2lab.js';\nimport oklab2rgb from '../oklab/oklab2rgb.js';\n\nconst oklch2rgb = (...args) => {\n args = unpack(args, 'lch');\n const [l, c, h] = args;\n const [L, a, b_] = lch2lab(l, c, h);\n const [r, g, b] = oklab2rgb(L, a, b_);\n return [r, g, b, args.length > 3 ? args[3] : 1];\n};\n\nexport default oklch2rgb;\n","import { unpack } from '../../utils/index.js';\nimport rgb2oklab from '../oklab/rgb2oklab.js';\nimport lab2lch from '../lch/lab2lch.js';\n\nconst rgb2oklch = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2oklab(r, g, b);\n return lab2lch(l, a, b_);\n};\n\nexport default rgb2oklch;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport oklch2rgb from './oklch2rgb.js';\nimport rgb2oklch from './rgb2oklch.js';\n\nColor.prototype.oklch = function () {\n return rgb2oklch(this._rgb);\n};\n\nchroma.oklch = (...args) => new Color(...args, 'oklch');\n\ninput.format.oklch = oklch2rgb;\n\ninput.autodetect.push({\n p: 3,\n test: (...args) => {\n args = unpack(args, 'oklch');\n if (type(args) === 'array' && args.length === 3) {\n return 'oklch';\n }\n }\n});\n","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\n\nColor.prototype.alpha = function (a, mutate = false) {\n if (a !== undefined && type(a) === 'number') {\n if (mutate) {\n this._rgb[3] = a;\n return this;\n }\n return new Color([this._rgb[0], this._rgb[1], this._rgb[2], a], 'rgb');\n }\n return this._rgb[3];\n};\n","import Color from '../Color.js';\n\nColor.prototype.clipped = function () {\n return this._rgb._clipped || false;\n};\n","import '../io/lab/index.js';\nimport Color from '../Color.js';\nimport LAB_CONSTANTS from '../io/lab/lab-constants.js';\n\nColor.prototype.darken = function (amount = 1) {\n const me = this;\n const lab = me.lab();\n lab[0] -= LAB_CONSTANTS.Kn * amount;\n return new Color(lab, 'lab').alpha(me.alpha(), true);\n};\n\nColor.prototype.brighten = function (amount = 1) {\n return this.darken(-amount);\n};\n\nColor.prototype.darker = Color.prototype.darken;\nColor.prototype.brighter = Color.prototype.brighten;\n","import Color from '../Color.js';\n\nColor.prototype.get = function (mc) {\n const [mode, channel] = mc.split('.');\n const src = this[mode]();\n if (channel) {\n const i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) return src[i];\n throw new Error(`unknown channel ${channel} in mode ${mode}`);\n } else {\n return src;\n }\n};\n","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\nconst { pow } = Math;\n\nconst EPS = 1e-7;\nconst MAX_ITER = 20;\n\nColor.prototype.luminance = function (lum, mode = 'rgb') {\n if (lum !== undefined && type(lum) === 'number') {\n if (lum === 0) {\n // return pure black\n return new Color([0, 0, 0, this._rgb[3]], 'rgb');\n }\n if (lum === 1) {\n // return pure white\n return new Color([255, 255, 255, this._rgb[3]], 'rgb');\n }\n // compute new color using...\n let cur_lum = this.luminance();\n let max_iter = MAX_ITER;\n\n const test = (low, high) => {\n const mid = low.interpolate(high, 0.5, mode);\n const lm = mid.luminance();\n if (Math.abs(lum - lm) < EPS || !max_iter--) {\n // close enough\n return mid;\n }\n return lm > lum ? test(low, mid) : test(mid, high);\n };\n\n const rgb = (\n cur_lum > lum\n ? test(new Color([0, 0, 0]), this)\n : test(this, new Color([255, 255, 255]))\n ).rgb();\n return new Color([...rgb, this._rgb[3]]);\n }\n return rgb2luminance(...this._rgb.slice(0, 3));\n};\n\nconst rgb2luminance = (r, g, b) => {\n // relative luminance\n // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n r = luminance_x(r);\n g = luminance_x(g);\n b = luminance_x(b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nconst luminance_x = (x) => {\n x /= 255;\n return x <= 0.03928 ? x / 12.92 : pow((x + 0.055) / 1.055, 2.4);\n};\n","export default {};\n","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\nimport interpolator from '../interpolator/index.js';\n\nexport default (col1, col2, f = 0.5, ...rest) => {\n let mode = rest[0] || 'lrgb';\n if (!interpolator[mode] && !rest.length) {\n // fall back to the first supported mode\n mode = Object.keys(interpolator)[0];\n }\n if (!interpolator[mode]) {\n throw new Error(`interpolation mode ${mode} is not defined`);\n }\n if (type(col1) !== 'object') col1 = new Color(col1);\n if (type(col2) !== 'object') col2 = new Color(col2);\n return interpolator[mode](col1, col2, f).alpha(\n col1.alpha() + f * (col2.alpha() - col1.alpha())\n );\n};\n","import Color from '../Color.js';\nimport mix from '../generator/mix.js';\n\nColor.prototype.mix = Color.prototype.interpolate = function (\n col2,\n f = 0.5,\n ...rest\n) {\n return mix(this, col2, f, ...rest);\n};\n","import Color from '../Color.js';\n\nColor.prototype.premultiply = function (mutate = false) {\n const rgb = this._rgb;\n const a = rgb[3];\n if (mutate) {\n this._rgb = [rgb[0] * a, rgb[1] * a, rgb[2] * a, a];\n return this;\n } else {\n return new Color([rgb[0] * a, rgb[1] * a, rgb[2] * a, a], 'rgb');\n }\n};\n","import '../io/lch/index.js';\nimport Color from '../Color.js';\nimport LAB_CONSTANTS from '../io/lab/lab-constants.js';\n\nColor.prototype.saturate = function (amount = 1) {\n const me = this;\n const lch = me.lch();\n lch[1] += LAB_CONSTANTS.Kn * amount;\n if (lch[1] < 0) lch[1] = 0;\n return new Color(lch, 'lch').alpha(me.alpha(), true);\n};\n\nColor.prototype.desaturate = function (amount = 1) {\n return this.saturate(-amount);\n};\n","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\n\nColor.prototype.set = function (mc, value, mutate = false) {\n const [mode, channel] = mc.split('.');\n const src = this[mode]();\n if (channel) {\n const i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) {\n if (type(value) == 'string') {\n switch (value.charAt(0)) {\n case '+':\n src[i] += +value;\n break;\n case '-':\n src[i] += +value;\n break;\n case '*':\n src[i] *= +value.substr(1);\n break;\n case '/':\n src[i] /= +value.substr(1);\n break;\n default:\n src[i] = +value;\n }\n } else if (type(value) === 'number') {\n src[i] = value;\n } else {\n throw new Error(`unsupported value for Color.set`);\n }\n const out = new Color(src, mode);\n if (mutate) {\n this._rgb = out._rgb;\n return this;\n }\n return out;\n }\n throw new Error(`unknown channel ${channel} in mode ${mode}`);\n } else {\n return src;\n }\n};\n","import '../io/lab/index.js';\nimport Color from '../Color.js';\nimport mix from '../generator/mix.js';\n\nColor.prototype.tint = function (f = 0.5, ...rest) {\n return mix(this, 'white', f, ...rest);\n};\n\nColor.prototype.shade = function (f = 0.5, ...rest) {\n return mix(this, 'black', f, ...rest);\n};\n","import Color from '../Color.js';\nimport index from './index.js';\n\nconst rgb = (col1, col2, f) => {\n const xyz0 = col1._rgb;\n const xyz1 = col2._rgb;\n return new Color(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'rgb'\n );\n};\n\n// register interpolator\nindex.rgb = rgb;\n\nexport default rgb;\n","import Color from '../Color.js';\nconst { sqrt, pow } = Math;\nimport index from './index.js';\n\nconst lrgb = (col1, col2, f) => {\n const [x1, y1, z1] = col1._rgb;\n const [x2, y2, z2] = col2._rgb;\n return new Color(\n sqrt(pow(x1, 2) * (1 - f) + pow(x2, 2) * f),\n sqrt(pow(y1, 2) * (1 - f) + pow(y2, 2) * f),\n sqrt(pow(z1, 2) * (1 - f) + pow(z2, 2) * f),\n 'rgb'\n );\n};\n\n// register interpolator\nindex.lrgb = lrgb;\n\nexport default lrgb;\n","import '../io/lab/index.js';\nimport index from './index.js';\nimport Color from '../Color.js';\n\nconst lab = (col1, col2, f) => {\n const xyz0 = col1.lab();\n const xyz1 = col2.lab();\n return new Color(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'lab'\n );\n};\n\n// register interpolator\nindex.lab = lab;\n\nexport default lab;\n","import Color from '../Color.js';\n\nexport default (col1, col2, f, m) => {\n let xyz0, xyz1;\n if (m === 'hsl') {\n xyz0 = col1.hsl();\n xyz1 = col2.hsl();\n } else if (m === 'hsv') {\n xyz0 = col1.hsv();\n xyz1 = col2.hsv();\n } else if (m === 'hcg') {\n xyz0 = col1.hcg();\n xyz1 = col2.hcg();\n } else if (m === 'hsi') {\n xyz0 = col1.hsi();\n xyz1 = col2.hsi();\n } else if (m === 'lch' || m === 'hcl') {\n m = 'hcl';\n xyz0 = col1.hcl();\n xyz1 = col2.hcl();\n } else if (m === 'oklch') {\n xyz0 = col1.oklch().reverse();\n xyz1 = col2.oklch().reverse();\n }\n\n let hue0, hue1, sat0, sat1, lbv0, lbv1;\n if (m.substr(0, 1) === 'h' || m === 'oklch') {\n [hue0, sat0, lbv0] = xyz0;\n [hue1, sat1, lbv1] = xyz1;\n }\n\n let sat, hue, lbv, dh;\n\n if (!isNaN(hue0) && !isNaN(hue1)) {\n // both colors have hue\n if (hue1 > hue0 && hue1 - hue0 > 180) {\n dh = hue1 - (hue0 + 360);\n } else if (hue1 < hue0 && hue0 - hue1 > 180) {\n dh = hue1 + 360 - hue0;\n } else {\n dh = hue1 - hue0;\n }\n hue = hue0 + f * dh;\n } else if (!isNaN(hue0)) {\n hue = hue0;\n if ((lbv1 == 1 || lbv1 == 0) && m != 'hsv') sat = sat0;\n } else if (!isNaN(hue1)) {\n hue = hue1;\n if ((lbv0 == 1 || lbv0 == 0) && m != 'hsv') sat = sat1;\n } else {\n hue = Number.NaN;\n }\n\n if (sat === undefined) sat = sat0 + f * (sat1 - sat0);\n lbv = lbv0 + f * (lbv1 - lbv0);\n return m === 'oklch'\n ? new Color([lbv, sat, hue], m)\n : new Color([hue, sat, lbv], m);\n};\n","import '../io/lch/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst lch = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'lch');\n};\n\n// register interpolator\nindex.lch = lch;\nindex.hcl = lch;\n\nexport default lch;\n","import '../io/num/index.js';\nimport index from './index.js';\n\nimport Color from '../Color.js';\n\nconst num = (col1, col2, f) => {\n const c1 = col1.num();\n const c2 = col2.num();\n return new Color(c1 + f * (c2 - c1), 'num');\n};\n\n// register interpolator\nindex.num = num;\n\nexport default num;\n","import '../io/hcg/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst hcg = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hcg');\n};\n\n// register interpolator\nindex.hcg = hcg;\n\nexport default hcg;\n","import '../io/hsi/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst hsi = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsi');\n};\n\n// register interpolator\nindex.hsi = hsi;\n\nexport default hsi;\n","import '../io/hsl/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst hsl = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsl');\n};\n\n// register interpolator\nindex.hsl = hsl;\n\nexport default hsl;\n","import '../io/hsv/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst hsv = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsv');\n};\n\n// register interpolator\nindex.hsv = hsv;\n\nexport default hsv;\n","import '../io/oklab/index.js';\nimport index from './index.js';\nimport Color from '../Color.js';\n\nconst oklab = (col1, col2, f) => {\n const xyz0 = col1.oklab();\n const xyz1 = col2.oklab();\n return new Color(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'oklab'\n );\n};\n\n// register interpolator\nindex.oklab = oklab;\n\nexport default oklab;\n","import '../io/lch/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst oklch = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'oklch');\n};\n\n// register interpolator\nindex.oklch = oklch;\n\nexport default oklch;\n","import Color from '../Color.js';\nimport { clip_rgb } from '../utils/index.js';\n\nconst { pow, sqrt, PI, cos, sin, atan2 } = Math;\n\nexport default (colors, mode = 'lrgb', weights = null) => {\n const l = colors.length;\n if (!weights) weights = Array.from(new Array(l)).map(() => 1);\n // normalize weights\n const k =\n l /\n weights.reduce(function (a, b) {\n return a + b;\n });\n weights.forEach((w, i) => {\n weights[i] *= k;\n });\n // convert colors to Color objects\n colors = colors.map((c) => new Color(c));\n if (mode === 'lrgb') {\n return _average_lrgb(colors, weights);\n }\n const first = colors.shift();\n const xyz = first.get(mode);\n const cnt = [];\n let dx = 0;\n let dy = 0;\n // initial color\n for (let i = 0; i < xyz.length; i++) {\n xyz[i] = (xyz[i] || 0) * weights[0];\n cnt.push(isNaN(xyz[i]) ? 0 : weights[0]);\n if (mode.charAt(i) === 'h' && !isNaN(xyz[i])) {\n const A = (xyz[i] / 180) * PI;\n dx += cos(A) * weights[0];\n dy += sin(A) * weights[0];\n }\n }\n\n let alpha = first.alpha() * weights[0];\n colors.forEach((c, ci) => {\n const xyz2 = c.get(mode);\n alpha += c.alpha() * weights[ci + 1];\n for (let i = 0; i < xyz.length; i++) {\n if (!isNaN(xyz2[i])) {\n cnt[i] += weights[ci + 1];\n if (mode.charAt(i) === 'h') {\n const A = (xyz2[i] / 180) * PI;\n dx += cos(A) * weights[ci + 1];\n dy += sin(A) * weights[ci + 1];\n } else {\n xyz[i] += xyz2[i] * weights[ci + 1];\n }\n }\n }\n });\n\n for (let i = 0; i < xyz.length; i++) {\n if (mode.charAt(i) === 'h') {\n let A = (atan2(dy / cnt[i], dx / cnt[i]) / PI) * 180;\n while (A < 0) A += 360;\n while (A >= 360) A -= 360;\n xyz[i] = A;\n } else {\n xyz[i] = xyz[i] / cnt[i];\n }\n }\n alpha /= l;\n return new Color(xyz, mode).alpha(alpha > 0.99999 ? 1 : alpha, true);\n};\n\nconst _average_lrgb = (colors, weights) => {\n const l = colors.length;\n const xyz = [0, 0, 0, 0];\n for (let i = 0; i < colors.length; i++) {\n const col = colors[i];\n const f = weights[i] / l;\n const rgb = col._rgb;\n xyz[0] += pow(rgb[0], 2) * f;\n xyz[1] += pow(rgb[1], 2) * f;\n xyz[2] += pow(rgb[2], 2) * f;\n xyz[3] += rgb[3] * f;\n }\n xyz[0] = sqrt(xyz[0]);\n xyz[1] = sqrt(xyz[1]);\n xyz[2] = sqrt(xyz[2]);\n if (xyz[3] > 0.9999999) xyz[3] = 1;\n return new Color(clip_rgb(xyz));\n};\n","// minimal multi-purpose interface\n\n// @requires utils color analyze\nimport chroma from '../chroma.js';\nimport { limit, type } from '../utils/index.js';\n\nconst { pow } = Math;\n\nexport default function (colors) {\n // constructor\n let _mode = 'rgb';\n let _nacol = chroma('#ccc');\n let _spread = 0;\n // const _fixed = false;\n let _domain = [0, 1];\n let _pos = [];\n let _padding = [0, 0];\n let _classes = false;\n let _colors = [];\n let _out = false;\n let _min = 0;\n let _max = 1;\n let _correctLightness = false;\n let _colorCache = {};\n let _useCache = true;\n let _gamma = 1;\n\n // private methods\n\n const setColors = function (colors) {\n colors = colors || ['#fff', '#000'];\n if (\n colors &&\n type(colors) === 'string' &&\n chroma.brewer &&\n chroma.brewer[colors.toLowerCase()]\n ) {\n colors = chroma.brewer[colors.toLowerCase()];\n }\n if (type(colors) === 'array') {\n // handle single color\n if (colors.length === 1) {\n colors = [colors[0], colors[0]];\n }\n // make a copy of the colors\n colors = colors.slice(0);\n // convert to chroma classes\n for (let c = 0; c < colors.length; c++) {\n colors[c] = chroma(colors[c]);\n }\n // auto-fill color position\n _pos.length = 0;\n for (let c = 0; c < colors.length; c++) {\n _pos.push(c / (colors.length - 1));\n }\n }\n resetCache();\n return (_colors = colors);\n };\n\n const getClass = function (value) {\n if (_classes != null) {\n const n = _classes.length - 1;\n let i = 0;\n while (i < n && value >= _classes[i]) {\n i++;\n }\n return i - 1;\n }\n return 0;\n };\n\n let tMapLightness = (t) => t;\n let tMapDomain = (t) => t;\n\n // const classifyValue = function(value) {\n // let val = value;\n // if (_classes.length > 2) {\n // const n = _classes.length-1;\n // const i = getClass(value);\n // const minc = _classes[0] + ((_classes[1]-_classes[0]) * (0 + (_spread * 0.5))); // center of 1st class\n // const maxc = _classes[n-1] + ((_classes[n]-_classes[n-1]) * (1 - (_spread * 0.5))); // center of last class\n // val = _min + ((((_classes[i] + ((_classes[i+1] - _classes[i]) * 0.5)) - minc) / (maxc-minc)) * (_max - _min));\n // }\n // return val;\n // };\n\n const getColor = function (val, bypassMap) {\n let col, t;\n if (bypassMap == null) {\n bypassMap = false;\n }\n if (isNaN(val) || val === null) {\n return _nacol;\n }\n if (!bypassMap) {\n if (_classes && _classes.length > 2) {\n // find the class\n const c = getClass(val);\n t = c / (_classes.length - 2);\n } else if (_max !== _min) {\n // just interpolate between min/max\n t = (val - _min) / (_max - _min);\n } else {\n t = 1;\n }\n } else {\n t = val;\n }\n\n // domain map\n t = tMapDomain(t);\n\n if (!bypassMap) {\n t = tMapLightness(t); // lightness correction\n }\n\n if (_gamma !== 1) {\n t = pow(t, _gamma);\n }\n\n t = _padding[0] + t * (1 - _padding[0] - _padding[1]);\n\n t = limit(t, 0, 1);\n\n const k = Math.floor(t * 10000);\n\n if (_useCache && _colorCache[k]) {\n col = _colorCache[k];\n } else {\n if (type(_colors) === 'array') {\n //for i in [0.._pos.length-1]\n for (let i = 0; i < _pos.length; i++) {\n const p = _pos[i];\n if (t <= p) {\n col = _colors[i];\n break;\n }\n if (t >= p && i === _pos.length - 1) {\n col = _colors[i];\n break;\n }\n if (t > p && t < _pos[i + 1]) {\n t = (t - p) / (_pos[i + 1] - p);\n col = chroma.interpolate(\n _colors[i],\n _colors[i + 1],\n t,\n _mode\n );\n break;\n }\n }\n } else if (type(_colors) === 'function') {\n col = _colors(t);\n }\n if (_useCache) {\n _colorCache[k] = col;\n }\n }\n return col;\n };\n\n var resetCache = () => (_colorCache = {});\n\n setColors(colors);\n\n // public interface\n\n const f = function (v) {\n const c = chroma(getColor(v));\n if (_out && c[_out]) {\n return c[_out]();\n } else {\n return c;\n }\n };\n\n f.classes = function (classes) {\n if (classes != null) {\n if (type(classes) === 'array') {\n _classes = classes;\n _domain = [classes[0], classes[classes.length - 1]];\n } else {\n const d = chroma.analyze(_domain);\n if (classes === 0) {\n _classes = [d.min, d.max];\n } else {\n _classes = chroma.limits(d, 'e', classes);\n }\n }\n return f;\n }\n return _classes;\n };\n\n f.domain = function (domain) {\n if (!arguments.length) {\n return _domain;\n }\n _min = domain[0];\n _max = domain[domain.length - 1];\n _pos = [];\n const k = _colors.length;\n if (domain.length === k && _min !== _max) {\n // update positions\n for (let d of Array.from(domain)) {\n _pos.push((d - _min) / (_max - _min));\n }\n } else {\n for (let c = 0; c < k; c++) {\n _pos.push(c / (k - 1));\n }\n if (domain.length > 2) {\n // set domain map\n const tOut = domain.map((d, i) => i / (domain.length - 1));\n const tBreaks = domain.map((d) => (d - _min) / (_max - _min));\n if (!tBreaks.every((val, i) => tOut[i] === val)) {\n tMapDomain = (t) => {\n if (t <= 0 || t >= 1) return t;\n let i = 0;\n while (t >= tBreaks[i + 1]) i++;\n const f =\n (t - tBreaks[i]) / (tBreaks[i + 1] - tBreaks[i]);\n const out = tOut[i] + f * (tOut[i + 1] - tOut[i]);\n return out;\n };\n }\n }\n }\n _domain = [_min, _max];\n return f;\n };\n\n f.mode = function (_m) {\n if (!arguments.length) {\n return _mode;\n }\n _mode = _m;\n resetCache();\n return f;\n };\n\n f.range = function (colors, _pos) {\n setColors(colors, _pos);\n return f;\n };\n\n f.out = function (_o) {\n _out = _o;\n return f;\n };\n\n f.spread = function (val) {\n if (!arguments.length) {\n return _spread;\n }\n _spread = val;\n return f;\n };\n\n f.correctLightness = function (v) {\n if (v == null) {\n v = true;\n }\n _correctLightness = v;\n resetCache();\n if (_correctLightness) {\n tMapLightness = function (t) {\n const L0 = getColor(0, true).lab()[0];\n const L1 = getColor(1, true).lab()[0];\n const pol = L0 > L1;\n let L_actual = getColor(t, true).lab()[0];\n const L_ideal = L0 + (L1 - L0) * t;\n let L_diff = L_actual - L_ideal;\n let t0 = 0;\n let t1 = 1;\n let max_iter = 20;\n while (Math.abs(L_diff) > 1e-2 && max_iter-- > 0) {\n (function () {\n if (pol) {\n L_diff *= -1;\n }\n if (L_diff < 0) {\n t0 = t;\n t += (t1 - t) * 0.5;\n } else {\n t1 = t;\n t += (t0 - t) * 0.5;\n }\n L_actual = getColor(t, true).lab()[0];\n return (L_diff = L_actual - L_ideal);\n })();\n }\n return t;\n };\n } else {\n tMapLightness = (t) => t;\n }\n return f;\n };\n\n f.padding = function (p) {\n if (p != null) {\n if (type(p) === 'number') {\n p = [p, p];\n }\n _padding = p;\n return f;\n } else {\n return _padding;\n }\n };\n\n f.colors = function (numColors, out) {\n // If no arguments are given, return the original colors that were provided\n if (arguments.length < 2) {\n out = 'hex';\n }\n let result = [];\n\n if (arguments.length === 0) {\n result = _colors.slice(0);\n } else if (numColors === 1) {\n result = [f(0.5)];\n } else if (numColors > 1) {\n const dm = _domain[0];\n const dd = _domain[1] - dm;\n result = __range__(0, numColors, false).map((i) =>\n f(dm + (i / (numColors - 1)) * dd)\n );\n } else {\n // returns all colors based on the defined classes\n colors = [];\n let samples = [];\n if (_classes && _classes.length > 2) {\n for (\n let i = 1, end = _classes.length, asc = 1 <= end;\n asc ? i < end : i > end;\n asc ? i++ : i--\n ) {\n samples.push((_classes[i - 1] + _classes[i]) * 0.5);\n }\n } else {\n samples = _domain;\n }\n result = samples.map((v) => f(v));\n }\n\n if (chroma[out]) {\n result = result.map((c) => c[out]());\n }\n return result;\n };\n\n f.cache = function (c) {\n if (c != null) {\n _useCache = c;\n return f;\n } else {\n return _useCache;\n }\n };\n\n f.gamma = function (g) {\n if (g != null) {\n _gamma = g;\n return f;\n } else {\n return _gamma;\n }\n };\n\n f.nodata = function (d) {\n if (d != null) {\n _nacol = chroma(d);\n return f;\n } else {\n return _nacol;\n }\n };\n\n return f;\n}\n\nfunction __range__(left, right, inclusive) {\n let range = [];\n let ascending = left < right;\n let end = !inclusive ? right : ascending ? right + 1 : right - 1;\n for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) {\n range.push(i);\n }\n return range;\n}\n","//\n// interpolates between a set of colors uzing a bezier spline\n//\n\n// @requires utils lab\nimport Color from '../Color.js';\nimport '../io/lab/index.js';\nimport scale from './scale.js';\n\n// nth row of the pascal triangle\nconst binom_row = function (n) {\n let row = [1, 1];\n for (let i = 1; i < n; i++) {\n let newrow = [1];\n for (let j = 1; j <= row.length; j++) {\n newrow[j] = (row[j] || 0) + row[j - 1];\n }\n row = newrow;\n }\n return row;\n};\n\nconst bezier = function (colors) {\n let I, lab0, lab1, lab2;\n colors = colors.map((c) => new Color(c));\n if (colors.length === 2) {\n // linear interpolation\n [lab0, lab1] = colors.map((c) => c.lab());\n I = function (t) {\n const lab = [0, 1, 2].map((i) => lab0[i] + t * (lab1[i] - lab0[i]));\n return new Color(lab, 'lab');\n };\n } else if (colors.length === 3) {\n // quadratic bezier interpolation\n [lab0, lab1, lab2] = colors.map((c) => c.lab());\n I = function (t) {\n const lab = [0, 1, 2].map(\n (i) =>\n (1 - t) * (1 - t) * lab0[i] +\n 2 * (1 - t) * t * lab1[i] +\n t * t * lab2[i]\n );\n return new Color(lab, 'lab');\n };\n } else if (colors.length === 4) {\n // cubic bezier interpolation\n let lab3;\n [lab0, lab1, lab2, lab3] = colors.map((c) => c.lab());\n I = function (t) {\n const lab = [0, 1, 2].map(\n (i) =>\n (1 - t) * (1 - t) * (1 - t) * lab0[i] +\n 3 * (1 - t) * (1 - t) * t * lab1[i] +\n 3 * (1 - t) * t * t * lab2[i] +\n t * t * t * lab3[i]\n );\n return new Color(lab, 'lab');\n };\n } else if (colors.length >= 5) {\n // general case (degree n bezier)\n let labs, row, n;\n labs = colors.map((c) => c.lab());\n n = colors.length - 1;\n row = binom_row(n);\n I = function (t) {\n const u = 1 - t;\n const lab = [0, 1, 2].map((i) =>\n labs.reduce(\n (sum, el, j) =>\n sum + row[j] * u ** (n - j) * t ** j * el[i],\n 0\n )\n );\n return new Color(lab, 'lab');\n };\n } else {\n throw new RangeError('No point in running bezier with only one color.');\n }\n return I;\n};\n\nexport default (colors) => {\n const f = bezier(colors);\n f.scale = () => scale(f);\n return f;\n};\n","/*\n * interpolates between a set of colors uzing a bezier spline\n * blend mode formulas taken from https://web.archive.org/web/20180110014946/http://www.venture-ware.com/kevin/coding/lets-learn-math-photoshop-blend-modes/\n */\n\nimport '../io/rgb/index.js';\nimport chroma from '../chroma.js';\n\nconst blend = (bottom, top, mode) => {\n if (!blend[mode]) {\n throw new Error('unknown blend mode ' + mode);\n }\n return blend[mode](bottom, top);\n};\n\nconst blend_f = (f) => (bottom, top) => {\n const c0 = chroma(top).rgb();\n const c1 = chroma(bottom).rgb();\n return chroma.rgb(f(c0, c1));\n};\n\nconst each = (f) => (c0, c1) => {\n const out = [];\n out[0] = f(c0[0], c1[0]);\n out[1] = f(c0[1], c1[1]);\n out[2] = f(c0[2], c1[2]);\n return out;\n};\n\nconst normal = (a) => a;\nconst multiply = (a, b) => (a * b) / 255;\nconst darken = (a, b) => (a > b ? b : a);\nconst lighten = (a, b) => (a > b ? a : b);\nconst screen = (a, b) => 255 * (1 - (1 - a / 255) * (1 - b / 255));\nconst overlay = (a, b) =>\n b < 128 ? (2 * a * b) / 255 : 255 * (1 - 2 * (1 - a / 255) * (1 - b / 255));\nconst burn = (a, b) => 255 * (1 - (1 - b / 255) / (a / 255));\nconst dodge = (a, b) => {\n if (a === 255) return 255;\n a = (255 * (b / 255)) / (1 - a / 255);\n return a > 255 ? 255 : a;\n};\n\n// # add = (a,b) ->\n// # if (a + b > 255) then 255 else a + b\n\nblend.normal = blend_f(each(normal));\nblend.multiply = blend_f(each(multiply));\nblend.screen = blend_f(each(screen));\nblend.overlay = blend_f(each(overlay));\nblend.darken = blend_f(each(darken));\nblend.lighten = blend_f(each(lighten));\nblend.dodge = blend_f(each(dodge));\nblend.burn = blend_f(each(burn));\n// blend.add = blend_f(each(add));\n\nexport default blend;\n","// cubehelix interpolation\n// based on D.A. Green \"A colour scheme for the display of astronomical intensity images\"\n// http://astron-soc.in/bulletin/11June/289392011.pdf\nimport { type, clip_rgb, TWOPI } from '../utils/index.js';\nimport chroma from '../chroma.js';\nconst { pow, sin, cos } = Math;\n\nexport default function (\n start = 300,\n rotations = -1.5,\n hue = 1,\n gamma = 1,\n lightness = [0, 1]\n) {\n let dh = 0,\n dl;\n if (type(lightness) === 'array') {\n dl = lightness[1] - lightness[0];\n } else {\n dl = 0;\n lightness = [lightness, lightness];\n }\n const f = function (fract) {\n const a = TWOPI * ((start + 120) / 360 + rotations * fract);\n const l = pow(lightness[0] + dl * fract, gamma);\n const h = dh !== 0 ? hue[0] + fract * dh : hue;\n const amp = (h * l * (1 - l)) / 2;\n const cos_a = cos(a);\n const sin_a = sin(a);\n const r = l + amp * (-0.14861 * cos_a + 1.78277 * sin_a);\n const g = l + amp * (-0.29227 * cos_a - 0.90649 * sin_a);\n const b = l + amp * (+1.97294 * cos_a);\n return chroma(clip_rgb([r * 255, g * 255, b * 255, 1]));\n };\n f.start = function (s) {\n if (s == null) {\n return start;\n }\n start = s;\n return f;\n };\n f.rotations = function (r) {\n if (r == null) {\n return rotations;\n }\n rotations = r;\n return f;\n };\n f.gamma = function (g) {\n if (g == null) {\n return gamma;\n }\n gamma = g;\n return f;\n };\n f.hue = function (h) {\n if (h == null) {\n return hue;\n }\n hue = h;\n if (type(hue) === 'array') {\n dh = hue[1] - hue[0];\n if (dh === 0) {\n hue = hue[1];\n }\n } else {\n dh = 0;\n }\n return f;\n };\n f.lightness = function (h) {\n if (h == null) {\n return lightness;\n }\n if (type(h) === 'array') {\n lightness = h;\n dl = h[1] - h[0];\n } else {\n lightness = [h, h];\n dl = 0;\n }\n return f;\n };\n f.scale = () => chroma.scale(f);\n f.hue(hue);\n return f;\n}\n","import Color from '../Color.js';\nconst digits = '0123456789abcdef';\n\nconst { floor, random } = Math;\n\nexport default () => {\n let code = '#';\n for (let i = 0; i < 6; i++) {\n code += digits.charAt(floor(random() * 16));\n }\n return new Color(code, 'hex');\n};\n","import type from './type.js';\n\nconst { log, pow, floor, abs } = Math;\n\nexport function analyze(data, key = null) {\n const r = {\n min: Number.MAX_VALUE,\n max: Number.MAX_VALUE * -1,\n sum: 0,\n values: [],\n count: 0\n };\n if (type(data) === 'object') {\n data = Object.values(data);\n }\n data.forEach((val) => {\n if (key && type(val) === 'object') val = val[key];\n if (val !== undefined && val !== null && !isNaN(val)) {\n r.values.push(val);\n r.sum += val;\n if (val < r.min) r.min = val;\n if (val > r.max) r.max = val;\n r.count += 1;\n }\n });\n\n r.domain = [r.min, r.max];\n\n r.limits = (mode, num) => limits(r, mode, num);\n\n return r;\n}\n\nexport function limits(data, mode = 'equal', num = 7) {\n if (type(data) == 'array') {\n data = analyze(data);\n }\n const { min, max } = data;\n const values = data.values.sort((a, b) => a - b);\n\n if (num === 1) {\n return [min, max];\n }\n\n const limits = [];\n\n if (mode.substr(0, 1) === 'c') {\n // continuous\n limits.push(min);\n limits.push(max);\n }\n\n if (mode.substr(0, 1) === 'e') {\n // equal interval\n limits.push(min);\n for (let i = 1; i < num; i++) {\n limits.push(min + (i / num) * (max - min));\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'l') {\n // log scale\n if (min <= 0) {\n throw new Error(\n 'Logarithmic scales are only possible for values > 0'\n );\n }\n const min_log = Math.LOG10E * log(min);\n const max_log = Math.LOG10E * log(max);\n limits.push(min);\n for (let i = 1; i < num; i++) {\n limits.push(pow(10, min_log + (i / num) * (max_log - min_log)));\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'q') {\n // quantile scale\n limits.push(min);\n for (let i = 1; i < num; i++) {\n const p = ((values.length - 1) * i) / num;\n const pb = floor(p);\n if (pb === p) {\n limits.push(values[pb]);\n } else {\n // p > pb\n const pr = p - pb;\n limits.push(values[pb] * (1 - pr) + values[pb + 1] * pr);\n }\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'k') {\n // k-means clustering\n /*\n implementation based on\n http://code.google.com/p/figue/source/browse/trunk/figue.js#336\n simplified for 1-d input values\n */\n let cluster;\n const n = values.length;\n const assignments = new Array(n);\n const clusterSizes = new Array(num);\n let repeat = true;\n let nb_iters = 0;\n let centroids = null;\n\n // get seed values\n centroids = [];\n centroids.push(min);\n for (let i = 1; i < num; i++) {\n centroids.push(min + (i / num) * (max - min));\n }\n centroids.push(max);\n\n while (repeat) {\n // assignment step\n for (let j = 0; j < num; j++) {\n clusterSizes[j] = 0;\n }\n for (let i = 0; i < n; i++) {\n const value = values[i];\n let mindist = Number.MAX_VALUE;\n let best;\n for (let j = 0; j < num; j++) {\n const dist = abs(centroids[j] - value);\n if (dist < mindist) {\n mindist = dist;\n best = j;\n }\n clusterSizes[best]++;\n assignments[i] = best;\n }\n }\n\n // update centroids step\n const newCentroids = new Array(num);\n for (let j = 0; j < num; j++) {\n newCentroids[j] = null;\n }\n for (let i = 0; i < n; i++) {\n cluster = assignments[i];\n if (newCentroids[cluster] === null) {\n newCentroids[cluster] = values[i];\n } else {\n newCentroids[cluster] += values[i];\n }\n }\n for (let j = 0; j < num; j++) {\n newCentroids[j] *= 1 / clusterSizes[j];\n }\n\n // check convergence\n repeat = false;\n for (let j = 0; j < num; j++) {\n if (newCentroids[j] !== centroids[j]) {\n repeat = true;\n break;\n }\n }\n\n centroids = newCentroids;\n nb_iters++;\n\n if (nb_iters > 200) {\n repeat = false;\n }\n }\n\n // finished k-means clustering\n // the next part is borrowed from gabrielflor.it\n const kClusters = {};\n for (let j = 0; j < num; j++) {\n kClusters[j] = [];\n }\n for (let i = 0; i < n; i++) {\n cluster = assignments[i];\n kClusters[cluster].push(values[i]);\n }\n let tmpKMeansBreaks = [];\n for (let j = 0; j < num; j++) {\n tmpKMeansBreaks.push(kClusters[j][0]);\n tmpKMeansBreaks.push(kClusters[j][kClusters[j].length - 1]);\n }\n tmpKMeansBreaks = tmpKMeansBreaks.sort((a, b) => a - b);\n limits.push(tmpKMeansBreaks[0]);\n for (let i = 1; i < tmpKMeansBreaks.length; i += 2) {\n const v = tmpKMeansBreaks[i];\n if (!isNaN(v) && limits.indexOf(v) === -1) {\n limits.push(v);\n }\n }\n }\n return limits;\n}\n","import Color from '../Color.js';\nimport '../ops/luminance.js';\n\nexport default (a, b) => {\n // WCAG contrast ratio\n // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef\n a = new Color(a);\n b = new Color(b);\n const l1 = a.luminance();\n const l2 = b.luminance();\n return l1 > l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);\n};\n","import Color from '../Color.js';\nconst { sqrt, pow, min, max, atan2, abs, cos, sin, exp, PI } = Math;\n\nexport default function (a, b, Kl = 1, Kc = 1, Kh = 1) {\n // Delta E (CIE 2000)\n // see http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE2000.html\n var rad2deg = function (rad) {\n return (360 * rad) / (2 * PI);\n };\n var deg2rad = function (deg) {\n return (2 * PI * deg) / 360;\n };\n a = new Color(a);\n b = new Color(b);\n const [L1, a1, b1] = Array.from(a.lab());\n const [L2, a2, b2] = Array.from(b.lab());\n const avgL = (L1 + L2) / 2;\n const C1 = sqrt(pow(a1, 2) + pow(b1, 2));\n const C2 = sqrt(pow(a2, 2) + pow(b2, 2));\n const avgC = (C1 + C2) / 2;\n const G = 0.5 * (1 - sqrt(pow(avgC, 7) / (pow(avgC, 7) + pow(25, 7))));\n const a1p = a1 * (1 + G);\n const a2p = a2 * (1 + G);\n const C1p = sqrt(pow(a1p, 2) + pow(b1, 2));\n const C2p = sqrt(pow(a2p, 2) + pow(b2, 2));\n const avgCp = (C1p + C2p) / 2;\n const arctan1 = rad2deg(atan2(b1, a1p));\n const arctan2 = rad2deg(atan2(b2, a2p));\n const h1p = arctan1 >= 0 ? arctan1 : arctan1 + 360;\n const h2p = arctan2 >= 0 ? arctan2 : arctan2 + 360;\n const avgHp =\n abs(h1p - h2p) > 180 ? (h1p + h2p + 360) / 2 : (h1p + h2p) / 2;\n const T =\n 1 -\n 0.17 * cos(deg2rad(avgHp - 30)) +\n 0.24 * cos(deg2rad(2 * avgHp)) +\n 0.32 * cos(deg2rad(3 * avgHp + 6)) -\n 0.2 * cos(deg2rad(4 * avgHp - 63));\n let deltaHp = h2p - h1p;\n deltaHp =\n abs(deltaHp) <= 180\n ? deltaHp\n : h2p <= h1p\n ? deltaHp + 360\n : deltaHp - 360;\n deltaHp = 2 * sqrt(C1p * C2p) * sin(deg2rad(deltaHp) / 2);\n const deltaL = L2 - L1;\n const deltaCp = C2p - C1p;\n const sl = 1 + (0.015 * pow(avgL - 50, 2)) / sqrt(20 + pow(avgL - 50, 2));\n const sc = 1 + 0.045 * avgCp;\n const sh = 1 + 0.015 * avgCp * T;\n const deltaTheta = 30 * exp(-pow((avgHp - 275) / 25, 2));\n const Rc = 2 * sqrt(pow(avgCp, 7) / (pow(avgCp, 7) + pow(25, 7)));\n const Rt = -Rc * sin(2 * deg2rad(deltaTheta));\n const result = sqrt(\n pow(deltaL / (Kl * sl), 2) +\n pow(deltaCp / (Kc * sc), 2) +\n pow(deltaHp / (Kh * sh), 2) +\n Rt * (deltaCp / (Kc * sc)) * (deltaHp / (Kh * sh))\n );\n return max(0, min(100, result));\n}\n","import Color from '../Color.js';\n\n// simple Euclidean distance\nexport default function (a, b, mode = 'lab') {\n // Delta E (CIE 1976)\n // see http://www.brucelindbloom.com/index.html?Equations.html\n a = new Color(a);\n b = new Color(b);\n const l1 = a.get(mode);\n const l2 = b.get(mode);\n let sum_sq = 0;\n for (let i in l1) {\n const d = (l1[i] || 0) - (l2[i] || 0);\n sum_sq += d * d;\n }\n return Math.sqrt(sum_sq);\n}\n","import Color from '../Color.js';\n\nexport default (...args) => {\n try {\n new Color(...args);\n return true;\n // eslint-disable-next-line\n } catch (e) {\n return false;\n }\n};\n","// some pre-defined color scales:\nimport chroma from '../chroma.js';\nimport '../io/hsl/index.js';\nimport scale from '../generator/scale.js';\n\nexport default {\n cool() {\n return scale([chroma.hsl(180, 1, 0.9), chroma.hsl(250, 0.7, 0.4)]);\n },\n hot() {\n return scale(['#000', '#f00', '#ff0', '#fff'], [0, 0.25, 0.75, 1]).mode(\n 'rgb'\n );\n }\n};\n","/**\n ColorBrewer colors for chroma.js\n\n Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The\n Pennsylvania State University.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software distributed\n under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n CONDITIONS OF ANY KIND, either express or implied. See the License for the\n specific language governing permissions and limitations under the License.\n*/\n\nconst colorbrewer = {\n // sequential\n OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],\n PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],\n BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],\n Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],\n BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],\n YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],\n YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],\n Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],\n RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],\n Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],\n YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],\n Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],\n GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],\n Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],\n YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],\n PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],\n Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],\n PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],\n Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],\n\n // diverging\n Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],\n RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],\n RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],\n PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],\n PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],\n RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],\n BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],\n RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],\n PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],\n\n // qualitative\n Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],\n Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],\n Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],\n Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],\n Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],\n Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],\n Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],\n Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2']\n};\n\n// add lowercase aliases for case-insensitive matches\nfor (let key of Object.keys(colorbrewer)) {\n colorbrewer[key.toLowerCase()] = colorbrewer[key];\n}\n\nexport default colorbrewer;\n","import chroma from './src/chroma.js';\n\n// feel free to comment out anything to rollup\n// a smaller chroma.js built\n\n// io --> convert colors\nimport './src/io/cmyk/index.js';\nimport './src/io/css/index.js';\nimport './src/io/gl/index.js';\nimport './src/io/hcg/index.js';\nimport './src/io/hex/index.js';\nimport './src/io/hsi/index.js';\nimport './src/io/hsl/index.js';\nimport './src/io/hsv/index.js';\nimport './src/io/lab/index.js';\nimport './src/io/lch/index.js';\nimport './src/io/named/index.js';\nimport './src/io/num/index.js';\nimport './src/io/rgb/index.js';\nimport './src/io/temp/index.js';\nimport './src/io/oklab/index.js';\nimport './src/io/oklch/index.js';\n\n// operators --> modify existing Colors\nimport './src/ops/alpha.js';\nimport './src/ops/clipped.js';\nimport './src/ops/darken.js';\nimport './src/ops/get.js';\nimport './src/ops/luminance.js';\nimport './src/ops/mix.js';\nimport './src/ops/premultiply.js';\nimport './src/ops/saturate.js';\nimport './src/ops/set.js';\nimport './src/ops/shade.js';\n\n// interpolators\nimport './src/interpolator/rgb.js';\nimport './src/interpolator/lrgb.js';\nimport './src/interpolator/lab.js';\nimport './src/interpolator/lch.js';\nimport './src/interpolator/num.js';\nimport './src/interpolator/hcg.js';\nimport './src/interpolator/hsi.js';\nimport './src/interpolator/hsl.js';\nimport './src/interpolator/hsv.js';\nimport './src/interpolator/oklab.js';\nimport './src/interpolator/oklch.js';\n\n// generators -- > create new colors\nimport average from './src/generator/average.js';\nimport bezier from './src/generator/bezier.js';\nimport blend from './src/generator/blend.js';\nimport cubehelix from './src/generator/cubehelix.js';\nimport mix from './src/generator/mix.js';\nimport random from './src/generator/random.js';\nimport scale from './src/generator/scale.js';\n\n// other utility methods\nimport { analyze } from './src/utils/analyze.js';\nimport contrast from './src/utils/contrast.js';\nimport deltaE from './src/utils/delta-e.js';\nimport distance from './src/utils/distance.js';\nimport { limits } from './src/utils/analyze.js';\nimport valid from './src/utils/valid.js';\nimport input from './src/io/input.js';\n\n// scale\nimport scales from './src/utils/scales.js';\n\n// colors\nimport colors from './src/colors/w3cx11.js';\nimport brewer from './src/colors/colorbrewer.js';\n\nObject.assign(chroma, {\n average,\n bezier,\n blend,\n cubehelix,\n mix,\n interpolate: mix,\n random,\n scale,\n analyze,\n contrast,\n deltaE,\n distance,\n limits,\n valid,\n scales,\n input,\n colors,\n brewer\n});\n\nexport default chroma;\n","const red = Object.freeze({\n base: '#f44336',\n lighten5: '#ffebee',\n lighten4: '#ffcdd2',\n lighten3: '#ef9a9a',\n lighten2: '#e57373',\n lighten1: '#ef5350',\n darken1: '#e53935',\n darken2: '#d32f2f',\n darken3: '#c62828',\n darken4: '#b71c1c',\n accent1: '#ff8a80',\n accent2: '#ff5252',\n accent3: '#ff1744',\n accent4: '#d50000',\n})\n\nconst pink = Object.freeze({\n base: '#e91e63',\n lighten5: '#fce4ec',\n lighten4: '#f8bbd0',\n lighten3: '#f48fb1',\n lighten2: '#f06292',\n lighten1: '#ec407a',\n darken1: '#d81b60',\n darken2: '#c2185b',\n darken3: '#ad1457',\n darken4: '#880e4f',\n accent1: '#ff80ab',\n accent2: '#ff4081',\n accent3: '#f50057',\n accent4: '#c51162',\n})\n\nconst purple = Object.freeze({\n base: '#9c27b0',\n lighten5: '#f3e5f5',\n lighten4: '#e1bee7',\n lighten3: '#ce93d8',\n lighten2: '#ba68c8',\n lighten1: '#ab47bc',\n darken1: '#8e24aa',\n darken2: '#7b1fa2',\n darken3: '#6a1b9a',\n darken4: '#4a148c',\n accent1: '#ea80fc',\n accent2: '#e040fb',\n accent3: '#d500f9',\n accent4: '#aa00ff',\n})\n\nconst deepPurple = Object.freeze({\n base: '#673ab7',\n lighten5: '#ede7f6',\n lighten4: '#d1c4e9',\n lighten3: '#b39ddb',\n lighten2: '#9575cd',\n lighten1: '#7e57c2',\n darken1: '#5e35b1',\n darken2: '#512da8',\n darken3: '#4527a0',\n darken4: '#311b92',\n accent1: '#b388ff',\n accent2: '#7c4dff',\n accent3: '#651fff',\n accent4: '#6200ea',\n})\n\nconst indigo = Object.freeze({\n base: '#3f51b5',\n lighten5: '#e8eaf6',\n lighten4: '#c5cae9',\n lighten3: '#9fa8da',\n lighten2: '#7986cb',\n lighten1: '#5c6bc0',\n darken1: '#3949ab',\n darken2: '#303f9f',\n darken3: '#283593',\n darken4: '#1a237e',\n accent1: '#8c9eff',\n accent2: '#536dfe',\n accent3: '#3d5afe',\n accent4: '#304ffe',\n})\n\nconst blue = Object.freeze({\n base: '#2196f3',\n lighten5: '#e3f2fd',\n lighten4: '#bbdefb',\n lighten3: '#90caf9',\n lighten2: '#64b5f6',\n lighten1: '#42a5f5',\n darken1: '#1e88e5',\n darken2: '#1976d2',\n darken3: '#1565c0',\n darken4: '#0d47a1',\n accent1: '#82b1ff',\n accent2: '#448aff',\n accent3: '#2979ff',\n accent4: '#2962ff',\n})\n\nconst lightBlue = Object.freeze({\n base: '#03a9f4',\n lighten5: '#e1f5fe',\n lighten4: '#b3e5fc',\n lighten3: '#81d4fa',\n lighten2: '#4fc3f7',\n lighten1: '#29b6f6',\n darken1: '#039be5',\n darken2: '#0288d1',\n darken3: '#0277bd',\n darken4: '#01579b',\n accent1: '#80d8ff',\n accent2: '#40c4ff',\n accent3: '#00b0ff',\n accent4: '#0091ea',\n})\n\nconst cyan = Object.freeze({\n base: '#00bcd4',\n lighten5: '#e0f7fa',\n lighten4: '#b2ebf2',\n lighten3: '#80deea',\n lighten2: '#4dd0e1',\n lighten1: '#26c6da',\n darken1: '#00acc1',\n darken2: '#0097a7',\n darken3: '#00838f',\n darken4: '#006064',\n accent1: '#84ffff',\n accent2: '#18ffff',\n accent3: '#00e5ff',\n accent4: '#00b8d4',\n})\n\nconst teal = Object.freeze({\n base: '#009688',\n lighten5: '#e0f2f1',\n lighten4: '#b2dfdb',\n lighten3: '#80cbc4',\n lighten2: '#4db6ac',\n lighten1: '#26a69a',\n darken1: '#00897b',\n darken2: '#00796b',\n darken3: '#00695c',\n darken4: '#004d40',\n accent1: '#a7ffeb',\n accent2: '#64ffda',\n accent3: '#1de9b6',\n accent4: '#00bfa5',\n})\n\nconst green = Object.freeze({\n base: '#4caf50',\n lighten5: '#e8f5e9',\n lighten4: '#c8e6c9',\n lighten3: '#a5d6a7',\n lighten2: '#81c784',\n lighten1: '#66bb6a',\n darken1: '#43a047',\n darken2: '#388e3c',\n darken3: '#2e7d32',\n darken4: '#1b5e20',\n accent1: '#b9f6ca',\n accent2: '#69f0ae',\n accent3: '#00e676',\n accent4: '#00c853',\n})\n\nconst lightGreen = Object.freeze({\n base: '#8bc34a',\n lighten5: '#f1f8e9',\n lighten4: '#dcedc8',\n lighten3: '#c5e1a5',\n lighten2: '#aed581',\n lighten1: '#9ccc65',\n darken1: '#7cb342',\n darken2: '#689f38',\n darken3: '#558b2f',\n darken4: '#33691e',\n accent1: '#ccff90',\n accent2: '#b2ff59',\n accent3: '#76ff03',\n accent4: '#64dd17',\n})\n\nconst lime = Object.freeze({\n base: '#cddc39',\n lighten5: '#f9fbe7',\n lighten4: '#f0f4c3',\n lighten3: '#e6ee9c',\n lighten2: '#dce775',\n lighten1: '#d4e157',\n darken1: '#c0ca33',\n darken2: '#afb42b',\n darken3: '#9e9d24',\n darken4: '#827717',\n accent1: '#f4ff81',\n accent2: '#eeff41',\n accent3: '#c6ff00',\n accent4: '#aeea00',\n})\n\nconst yellow = Object.freeze({\n base: '#ffeb3b',\n lighten5: '#fffde7',\n lighten4: '#fff9c4',\n lighten3: '#fff59d',\n lighten2: '#fff176',\n lighten1: '#ffee58',\n darken1: '#fdd835',\n darken2: '#fbc02d',\n darken3: '#f9a825',\n darken4: '#f57f17',\n accent1: '#ffff8d',\n accent2: '#ffff00',\n accent3: '#ffea00',\n accent4: '#ffd600',\n})\n\nconst amber = Object.freeze({\n base: '#ffc107',\n lighten5: '#fff8e1',\n lighten4: '#ffecb3',\n lighten3: '#ffe082',\n lighten2: '#ffd54f',\n lighten1: '#ffca28',\n darken1: '#ffb300',\n darken2: '#ffa000',\n darken3: '#ff8f00',\n darken4: '#ff6f00',\n accent1: '#ffe57f',\n accent2: '#ffd740',\n accent3: '#ffc400',\n accent4: '#ffab00',\n})\n\nconst orange = Object.freeze({\n base: '#ff9800',\n lighten5: '#fff3e0',\n lighten4: '#ffe0b2',\n lighten3: '#ffcc80',\n lighten2: '#ffb74d',\n lighten1: '#ffa726',\n darken1: '#fb8c00',\n darken2: '#f57c00',\n darken3: '#ef6c00',\n darken4: '#e65100',\n accent1: '#ffd180',\n accent2: '#ffab40',\n accent3: '#ff9100',\n accent4: '#ff6d00',\n})\n\nconst deepOrange = Object.freeze({\n base: '#ff5722',\n lighten5: '#fbe9e7',\n lighten4: '#ffccbc',\n lighten3: '#ffab91',\n lighten2: '#ff8a65',\n lighten1: '#ff7043',\n darken1: '#f4511e',\n darken2: '#e64a19',\n darken3: '#d84315',\n darken4: '#bf360c',\n accent1: '#ff9e80',\n accent2: '#ff6e40',\n accent3: '#ff3d00',\n accent4: '#dd2c00',\n})\n\nconst brown = Object.freeze({\n base: '#795548',\n lighten5: '#efebe9',\n lighten4: '#d7ccc8',\n lighten3: '#bcaaa4',\n lighten2: '#a1887f',\n lighten1: '#8d6e63',\n darken1: '#6d4c41',\n darken2: '#5d4037',\n darken3: '#4e342e',\n darken4: '#3e2723',\n})\n\nconst blueGrey = Object.freeze({\n base: '#607d8b',\n lighten5: '#eceff1',\n lighten4: '#cfd8dc',\n lighten3: '#b0bec5',\n lighten2: '#90a4ae',\n lighten1: '#78909c',\n darken1: '#546e7a',\n darken2: '#455a64',\n darken3: '#37474f',\n darken4: '#263238',\n})\n\nconst grey = Object.freeze({\n base: '#9e9e9e',\n lighten5: '#fafafa',\n lighten4: '#f5f5f5',\n lighten3: '#eeeeee',\n lighten2: '#e0e0e0',\n lighten1: '#bdbdbd',\n darken1: '#757575',\n darken2: '#616161',\n darken3: '#424242',\n darken4: '#212121',\n})\n\nconst shades = Object.freeze({\n black: '#000000',\n white: '#ffffff',\n transparent: 'transparent',\n})\n\nexport default Object.freeze({\n red,\n pink,\n purple,\n deepPurple,\n indigo,\n blue,\n lightBlue,\n cyan,\n teal,\n green,\n lightGreen,\n lime,\n yellow,\n amber,\n orange,\n deepOrange,\n brown,\n blueGrey,\n grey,\n shades,\n})\n","import chroma from \"chroma-js\";\nimport colors from \"vuetify/lib/util/colors\";\n\nfunction shuffle(array, seed) {\n // <-- ADDED ARGUMENT\n var m = array.length,\n t,\n i;\n\n // While there remain elements to shuffle…\n while (m) {\n // Pick a remaining element…\n i = Math.floor(random(seed) * m--); // <-- MODIFIED LINE\n\n // And swap it with the current element.\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n ++seed; // <-- ADDED LINE\n }\n\n return array;\n}\n\nfunction random(seed) {\n var x = Math.sin(seed++) * 10000; \n return x - Math.floor(x);\n}\n\nconst colorArray = Object.entries(colors)\n .filter(([key, val]) => key != \"shades\")\n .map(([, val]) =>\n chroma\n .scale([val.darken4, val.darken2, val.base, val.lighten2])\n .correctLightness()\n .colors()\n )\n .flat();\n\nexport default shuffle(colorArray, 7);\n"],"sourceRoot":""}