{"version":3,"sources":["node_modules/chroma-js/src/utils/limit.js","node_modules/chroma-js/src/utils/clip_rgb.js","node_modules/chroma-js/src/utils/type.js","node_modules/chroma-js/src/utils/unpack.js","node_modules/chroma-js/src/utils/last.js","node_modules/chroma-js/src/utils/index.js","node_modules/chroma-js/src/io/input.js","node_modules/chroma-js/src/Color.js","node_modules/chroma-js/src/version.js","node_modules/chroma-js/src/chroma.js","node_modules/chroma-js/src/colors/w3cx11.js","node_modules/chroma-js/src/io/hex/hex2rgb.js","node_modules/chroma-js/src/io/hex/rgb2hex.js","node_modules/chroma-js/src/io/named/index.js","node_modules/chroma-js/src/ops/alpha.js","node_modules/chroma-js/src/ops/clipped.js","node_modules/chroma-js/src/io/lab/lab-constants.js","node_modules/chroma-js/src/io/lab/lab2rgb.js","node_modules/chroma-js/src/io/lab/rgb2lab.js","node_modules/chroma-js/src/io/lab/index.js","node_modules/chroma-js/src/ops/darken.js","node_modules/chroma-js/src/ops/get.js","node_modules/chroma-js/src/ops/luminance.js","node_modules/chroma-js/src/interpolator/index.js","node_modules/chroma-js/src/generator/mix.js","node_modules/chroma-js/src/ops/mix.js","node_modules/chroma-js/src/ops/premultiply.js","node_modules/chroma-js/src/io/lch/lch2lab.js","node_modules/chroma-js/src/io/lch/lch2rgb.js","node_modules/chroma-js/src/io/lch/hcl2rgb.js","node_modules/chroma-js/src/io/lch/lab2lch.js","node_modules/chroma-js/src/io/lch/rgb2lch.js","node_modules/chroma-js/src/io/lch/index.js","node_modules/chroma-js/src/ops/saturate.js","node_modules/chroma-js/src/ops/set.js","node_modules/chroma-js/src/ops/shade.js","node_modules/chroma-js/src/interpolator/rgb.js","node_modules/chroma-js/src/interpolator/lrgb.js","node_modules/chroma-js/src/interpolator/lab.js","node_modules/chroma-js/src/interpolator/_hsx.js","node_modules/chroma-js/src/interpolator/lch.js","node_modules/chroma-js/src/io/num/num2rgb.js","node_modules/chroma-js/src/io/num/rgb2num.js","node_modules/chroma-js/src/io/num/index.js","node_modules/chroma-js/src/interpolator/num.js","node_modules/chroma-js/src/io/hcg/hcg2rgb.js","node_modules/chroma-js/src/io/hcg/rgb2hcg.js","node_modules/chroma-js/src/io/hcg/index.js","node_modules/chroma-js/src/interpolator/hcg.js","node_modules/chroma-js/src/io/hsi/hsi2rgb.js","node_modules/chroma-js/src/io/hsi/rgb2hsi.js","node_modules/chroma-js/src/io/hsi/index.js","node_modules/chroma-js/src/interpolator/hsi.js","node_modules/chroma-js/src/io/hsl/hsl2rgb.js","node_modules/chroma-js/src/io/hsl/rgb2hsl.js","node_modules/chroma-js/src/io/hsl/index.js","node_modules/chroma-js/src/interpolator/hsl.js","node_modules/chroma-js/src/io/hsv/hsv2rgb.js","node_modules/chroma-js/src/io/hsv/rgb2hsv.js","node_modules/chroma-js/src/io/hsv/index.js","node_modules/chroma-js/src/interpolator/hsv.js","node_modules/chroma-js/src/utils/multiply-matrices.js","node_modules/chroma-js/src/io/oklab/oklab2rgb.js","node_modules/chroma-js/src/io/oklab/rgb2oklab.js","node_modules/chroma-js/src/io/oklab/index.js","node_modules/chroma-js/src/interpolator/oklab.js","node_modules/chroma-js/src/interpolator/oklch.js","node_modules/chroma-js/src/generator/average.js","node_modules/chroma-js/src/generator/scale.js","node_modules/chroma-js/src/generator/bezier.js","node_modules/chroma-js/src/io/rgb/index.js","node_modules/chroma-js/src/generator/blend.js","node_modules/chroma-js/src/generator/cubehelix.js","node_modules/chroma-js/src/generator/random.js","node_modules/chroma-js/src/utils/analyze.js","node_modules/chroma-js/src/utils/contrast.js","node_modules/chroma-js/src/utils/contrastAPCA.js","node_modules/chroma-js/src/utils/delta-e.js","node_modules/chroma-js/src/utils/distance.js","node_modules/chroma-js/src/utils/valid.js","node_modules/chroma-js/src/utils/scales.js","node_modules/chroma-js/src/colors/colorbrewer.js","node_modules/chroma-js/src/io/cmyk/cmyk2rgb.js","node_modules/chroma-js/src/io/cmyk/rgb2cmyk.js","node_modules/chroma-js/src/io/cmyk/index.js","node_modules/chroma-js/src/io/css/hsl2css.js","node_modules/chroma-js/src/io/css/lab2css.js","node_modules/chroma-js/src/io/css/lch2css.js","node_modules/chroma-js/src/io/css/oklab2css.js","node_modules/chroma-js/src/io/oklch/rgb2oklch.js","node_modules/chroma-js/src/io/css/oklch2css.js","node_modules/chroma-js/src/io/css/rgb2css.js","node_modules/chroma-js/src/io/oklch/oklch2rgb.js","node_modules/chroma-js/src/io/css/css2rgb.js","node_modules/chroma-js/src/io/css/index.js","node_modules/chroma-js/src/io/gl/index.js","node_modules/chroma-js/src/io/hex/index.js","node_modules/chroma-js/src/io/temp/temperature2rgb.js","node_modules/chroma-js/src/io/temp/rgb2temperature.js","node_modules/chroma-js/src/io/temp/index.js","node_modules/chroma-js/src/io/oklch/index.js","node_modules/chroma-js/index.js"],"sourcesContent":["const {\n min,\n max\n} = Math;\nexport default (x, low = 0, high = 1) => {\n return min(max(low, x), high);\n};","import limit from './limit.js';\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};","// ported from jQuery's $.type\nconst classToType = {};\nfor (let name of ['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp', 'Undefined', 'Null']) {\n classToType[`[object ${name}]`] = name.toLowerCase();\n}\nexport default function (obj) {\n return classToType[Object.prototype.toString.call(obj)] || 'object';\n}","import type from './type.js';\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.split('').filter(k => args[0][k] !== undefined).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].slice(0);\n};","import type from './type.js';\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};","const {\n PI,\n min,\n max\n} = Math;\nconst rnd2 = a => Math.round(a * 100) / 100;\nconst rnd3 = a => Math.round(a * 100) / 100;\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';\nconst TWOPI = PI * 2;\nconst PITHIRD = PI / 3;\nconst DEG2RAD = PI / 180;\nconst RAD2DEG = 180 / PI;\n\n/**\n * Reverse the first three elements of an array\n *\n * @param {any[]} arr\n * @returns {any[]}\n */\nfunction reverse3(arr) {\n return [...arr.slice(0, 3).reverse(), ...arr.slice(3)];\n}\nexport { PI, TWOPI, PITHIRD, DEG2RAD, RAD2DEG, min, max, rnd2, rnd3, reverse3 };","export default {\n format: {},\n autodetect: []\n};","import { last, clip_rgb, type } from './utils/index.js';\nimport _input from './io/input.js';\nclass Color {\n constructor(...args) {\n const me = this;\n if (type(args[0]) === 'object' && args[0].constructor && args[0].constructor === this.constructor) {\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\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(null, autodetect ? args : args.slice(0, -1));\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;","// this gets updated automatically\nexport const version = '3.1.2';","import Color from './Color.js';\nimport { version } from './version.js';\nconst chroma = (...args) => {\n return new Color(...args);\n};\nchroma.version = version;\nexport default chroma;","/**\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};\nexport default w3cx11;","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})$/;\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 = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + 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};\nexport default hex2rgb;","import { unpack, last } from '../../utils/index.js';\nconst {\n round\n} = Math;\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};\nexport default rgb2hex;","import Color from '../../Color.js';\nimport input from '../input.js';\nimport { type } from '../../utils/index.js';\nimport w3cx11 from '../../colors/w3cx11.js';\nimport hex2rgb from '../hex/hex2rgb.js';\nimport rgb2hex from '../hex/rgb2hex.js';\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};\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};\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});","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\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};","import Color from '../Color.js';\nColor.prototype.clipped = function () {\n return this._rgb._clipped || false;\n};","const labConstants = {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n // D65 standard referent\n labWhitePoint: 'd65',\n Xn: 0.95047,\n Yn: 1,\n Zn: 1.08883,\n t0: 0.137931034,\n // 4 / 29\n t1: 0.206896552,\n // 6 / 29\n t2: 0.12841855,\n // 3 * t1 * t1\n t3: 0.008856452,\n // t1 * t1 * t1,\n\n kE: 216.0 / 24389.0,\n kKE: 8.0,\n kK: 24389.0 / 27.0,\n RefWhiteRGB: {\n // sRGB\n X: 0.95047,\n Y: 1,\n Z: 1.08883\n },\n MtxRGB2XYZ: {\n m00: 0.4124564390896922,\n m01: 0.21267285140562253,\n m02: 0.0193338955823293,\n m10: 0.357576077643909,\n m11: 0.715152155287818,\n m12: 0.11919202588130297,\n m20: 0.18043748326639894,\n m21: 0.07217499330655958,\n m22: 0.9503040785363679\n },\n MtxXYZ2RGB: {\n m00: 3.2404541621141045,\n m01: -0.9692660305051868,\n m02: 0.055643430959114726,\n m10: -1.5371385127977166,\n m11: 1.8760108454466942,\n m12: -0.2040259135167538,\n m20: -0.498531409556016,\n m21: 0.041556017530349834,\n m22: 1.0572251882231791\n },\n // used in rgb2xyz\n As: 0.9414285350000001,\n Bs: 1.040417467,\n Cs: 1.089532651,\n MtxAdaptMa: {\n m00: 0.8951,\n m01: -0.7502,\n m02: 0.0389,\n m10: 0.2664,\n m11: 1.7135,\n m12: -0.0685,\n m20: -0.1614,\n m21: 0.0367,\n m22: 1.0296\n },\n MtxAdaptMaI: {\n m00: 0.9869929054667123,\n m01: 0.43230526972339456,\n m02: -0.008528664575177328,\n m10: -0.14705425642099013,\n m11: 0.5183602715367776,\n m12: 0.04004282165408487,\n m20: 0.15996265166373125,\n m21: 0.0492912282128556,\n m22: 0.9684866957875502\n }\n};\nexport default labConstants;\n\n// taken from https://de.mathworks.com/help/images/ref/whitepoint.html\nconst ILLUMINANTS = new Map([\n// ASTM E308-01\n['a', [1.0985, 0.35585]],\n// Wyszecki & Stiles, p. 769\n['b', [1.0985, 0.35585]],\n// C ASTM E308-01\n['c', [0.98074, 1.18232]],\n// D50 (ASTM E308-01)\n['d50', [0.96422, 0.82521]],\n// D55 (ASTM E308-01)\n['d55', [0.95682, 0.92149]],\n// D65 (ASTM E308-01)\n['d65', [0.95047, 1.08883]],\n// E (ASTM E308-01)\n['e', [1, 1, 1]],\n// F2 (ASTM E308-01)\n['f2', [0.99186, 0.67393]],\n// F7 (ASTM E308-01)\n['f7', [0.95041, 1.08747]],\n// F11 (ASTM E308-01)\n['f11', [1.00962, 0.6435]], ['icc', [0.96422, 0.82521]]]);\nexport function setLabWhitePoint(name) {\n const ill = ILLUMINANTS.get(String(name).toLowerCase());\n if (!ill) {\n throw new Error('unknown Lab illuminant ' + name);\n }\n labConstants.labWhitePoint = name;\n labConstants.Xn = ill[0];\n labConstants.Zn = ill[1];\n}\nexport function getLabWhitePoint() {\n return labConstants.labWhitePoint;\n}","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\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 const [x, y, z] = lab2xyz(L, a, b);\n const [r, g, b_] = xyz2rgb(x, y, z);\n return [r, g, b_, args.length > 3 ? args[3] : 1];\n};\nconst lab2xyz = (L, a, b) => {\n const {\n kE,\n kK,\n kKE,\n Xn,\n Yn,\n Zn\n } = LAB_CONSTANTS;\n const fy = (L + 16.0) / 116.0;\n const fx = 0.002 * a + fy;\n const fz = fy - 0.005 * b;\n const fx3 = fx * fx * fx;\n const fz3 = fz * fz * fz;\n const xr = fx3 > kE ? fx3 : (116.0 * fx - 16.0) / kK;\n const yr = L > kKE ? Math.pow((L + 16.0) / 116.0, 3.0) : L / kK;\n const zr = fz3 > kE ? fz3 : (116.0 * fz - 16.0) / kK;\n const x = xr * Xn;\n const y = yr * Yn;\n const z = zr * Zn;\n return [x, y, z];\n};\nconst compand = linear => {\n /* sRGB */\n const sign = Math.sign(linear);\n linear = Math.abs(linear);\n return (linear <= 0.0031308 ? linear * 12.92 : 1.055 * Math.pow(linear, 1.0 / 2.4) - 0.055) * sign;\n};\nconst xyz2rgb = (x, y, z) => {\n const {\n MtxAdaptMa,\n MtxAdaptMaI,\n MtxXYZ2RGB,\n RefWhiteRGB,\n Xn,\n Yn,\n Zn\n } = LAB_CONSTANTS;\n const As = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;\n const Bs = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;\n const Cs = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;\n const Ad = RefWhiteRGB.X * MtxAdaptMa.m00 + RefWhiteRGB.Y * MtxAdaptMa.m10 + RefWhiteRGB.Z * MtxAdaptMa.m20;\n const Bd = RefWhiteRGB.X * MtxAdaptMa.m01 + RefWhiteRGB.Y * MtxAdaptMa.m11 + RefWhiteRGB.Z * MtxAdaptMa.m21;\n const Cd = RefWhiteRGB.X * MtxAdaptMa.m02 + RefWhiteRGB.Y * MtxAdaptMa.m12 + RefWhiteRGB.Z * MtxAdaptMa.m22;\n const X1 = (x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20) * (Ad / As);\n const Y1 = (x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21) * (Bd / Bs);\n const Z1 = (x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22) * (Cd / Cs);\n const X2 = X1 * MtxAdaptMaI.m00 + Y1 * MtxAdaptMaI.m10 + Z1 * MtxAdaptMaI.m20;\n const Y2 = X1 * MtxAdaptMaI.m01 + Y1 * MtxAdaptMaI.m11 + Z1 * MtxAdaptMaI.m21;\n const Z2 = X1 * MtxAdaptMaI.m02 + Y1 * MtxAdaptMaI.m12 + Z1 * MtxAdaptMaI.m22;\n const r = compand(X2 * MtxXYZ2RGB.m00 + Y2 * MtxXYZ2RGB.m10 + Z2 * MtxXYZ2RGB.m20);\n const g = compand(X2 * MtxXYZ2RGB.m01 + Y2 * MtxXYZ2RGB.m11 + Z2 * MtxXYZ2RGB.m21);\n const b = compand(X2 * MtxXYZ2RGB.m02 + Y2 * MtxXYZ2RGB.m12 + Z2 * MtxXYZ2RGB.m22);\n return [r * 255, g * 255, b * 255];\n};\nexport default lab2rgb;\nexport { xyz2rgb };","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\nconst rgb2lab = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [x, y, z] = rgb2xyz(r, g, b);\n const [L, a, b_] = xyz2lab(x, y, z);\n return [L, a, b_, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\nfunction xyz2lab(x, y, z) {\n const {\n Xn,\n Yn,\n Zn,\n kE,\n kK\n } = LAB_CONSTANTS;\n const xr = x / Xn;\n const yr = y / Yn;\n const zr = z / Zn;\n const fx = xr > kE ? Math.pow(xr, 1.0 / 3.0) : (kK * xr + 16.0) / 116.0;\n const fy = yr > kE ? Math.pow(yr, 1.0 / 3.0) : (kK * yr + 16.0) / 116.0;\n const fz = zr > kE ? Math.pow(zr, 1.0 / 3.0) : (kK * zr + 16.0) / 116.0;\n return [116.0 * fy - 16.0, 500.0 * (fx - fy), 200.0 * (fy - fz)];\n}\nfunction gammaAdjustSRGB(companded) {\n const sign = Math.sign(companded);\n companded = Math.abs(companded);\n const linear = companded <= 0.04045 ? companded / 12.92 : Math.pow((companded + 0.055) / 1.055, 2.4);\n return linear * sign;\n}\nconst rgb2xyz = (r, g, b) => {\n // normalize and gamma adjust\n r = gammaAdjustSRGB(r / 255);\n g = gammaAdjustSRGB(g / 255);\n b = gammaAdjustSRGB(b / 255);\n const {\n MtxRGB2XYZ,\n MtxAdaptMa,\n MtxAdaptMaI,\n Xn,\n Yn,\n Zn,\n As,\n Bs,\n Cs\n } = LAB_CONSTANTS;\n let x = r * MtxRGB2XYZ.m00 + g * MtxRGB2XYZ.m10 + b * MtxRGB2XYZ.m20;\n let y = r * MtxRGB2XYZ.m01 + g * MtxRGB2XYZ.m11 + b * MtxRGB2XYZ.m21;\n let z = r * MtxRGB2XYZ.m02 + g * MtxRGB2XYZ.m12 + b * MtxRGB2XYZ.m22;\n const Ad = Xn * MtxAdaptMa.m00 + Yn * MtxAdaptMa.m10 + Zn * MtxAdaptMa.m20;\n const Bd = Xn * MtxAdaptMa.m01 + Yn * MtxAdaptMa.m11 + Zn * MtxAdaptMa.m21;\n const Cd = Xn * MtxAdaptMa.m02 + Yn * MtxAdaptMa.m12 + Zn * MtxAdaptMa.m22;\n let X = x * MtxAdaptMa.m00 + y * MtxAdaptMa.m10 + z * MtxAdaptMa.m20;\n let Y = x * MtxAdaptMa.m01 + y * MtxAdaptMa.m11 + z * MtxAdaptMa.m21;\n let Z = x * MtxAdaptMa.m02 + y * MtxAdaptMa.m12 + z * MtxAdaptMa.m22;\n X *= Ad / As;\n Y *= Bd / Bs;\n Z *= Cd / Cs;\n x = X * MtxAdaptMaI.m00 + Y * MtxAdaptMaI.m10 + Z * MtxAdaptMaI.m20;\n y = X * MtxAdaptMaI.m01 + Y * MtxAdaptMaI.m11 + Z * MtxAdaptMaI.m21;\n z = X * MtxAdaptMaI.m02 + Y * MtxAdaptMaI.m12 + Z * MtxAdaptMaI.m22;\n return [x, y, z];\n};\nexport default rgb2lab;\nexport { rgb2xyz };","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';\nimport { getLabWhitePoint, setLabWhitePoint } from './lab-constants.js';\nColor.prototype.lab = function () {\n return rgb2lab(this._rgb);\n};\nconst lab = (...args) => new Color(...args, 'lab');\nObject.assign(chroma, {\n lab,\n getLabWhitePoint,\n setLabWhitePoint\n});\ninput.format.lab = lab2rgb;\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});\nexport { lab, getLabWhitePoint, setLabWhitePoint };","import '../io/lab/index.js';\nimport Color from '../Color.js';\nimport LAB_CONSTANTS from '../io/lab/lab-constants.js';\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};\nColor.prototype.brighten = function (amount = 1) {\n return this.darken(-amount);\n};\nColor.prototype.darker = Color.prototype.darken;\nColor.prototype.brighter = Color.prototype.brighten;","import Color from '../Color.js';\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};","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\nconst {\n pow\n} = Math;\nconst EPS = 1e-7;\nconst MAX_ITER = 20;\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 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 const rgb = (cur_lum > lum ? test(new Color([0, 0, 0]), this) : test(this, new Color([255, 255, 255]))).rgb();\n return new Color([...rgb, this._rgb[3]]);\n }\n return rgb2luminance(...this._rgb.slice(0, 3));\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};\nconst luminance_x = x => {\n x /= 255;\n return x <= 0.03928 ? x / 12.92 : pow((x + 0.055) / 1.055, 2.4);\n};","export default {};","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\nimport interpolator from '../interpolator/index.js';\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(col1.alpha() + f * (col2.alpha() - col1.alpha()));\n};","import Color from '../Color.js';\nimport mix from '../generator/mix.js';\nColor.prototype.mix = Color.prototype.interpolate = function (col2, f = 0.5, ...rest) {\n return mix(this, col2, f, ...rest);\n};","import Color from '../Color.js';\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};","import { unpack, DEG2RAD } from '../../utils/index.js';\nconst {\n sin,\n cos\n} = Math;\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 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};\nexport default lch2lab;","import { unpack } from '../../utils/index.js';\nimport lch2lab from './lch2lab.js';\nimport lab2rgb from '../lab/lab2rgb.js';\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};\nexport default lch2rgb;","import { unpack, reverse3 } from '../../utils/index.js';\nimport lch2rgb from './lch2rgb.js';\nconst hcl2rgb = (...args) => {\n const hcl = reverse3(unpack(args, 'hcl'));\n return lch2rgb(...hcl);\n};\nexport default hcl2rgb;","import { unpack, RAD2DEG } from '../../utils/index.js';\nconst {\n sqrt,\n atan2,\n round\n} = Math;\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};\nexport default lab2lch;","import { unpack } from '../../utils/index.js';\nimport rgb2lab from '../lab/rgb2lab.js';\nimport lab2lch from './lab2lch.js';\nconst rgb2lch = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2lab(r, g, b);\n const [L, c, h] = lab2lch(l, a, b_);\n return [L, c, h, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\nexport default rgb2lch;","import { unpack, type, reverse3 } 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';\nColor.prototype.lch = function () {\n return rgb2lch(this._rgb);\n};\nColor.prototype.hcl = function () {\n return reverse3(rgb2lch(this._rgb));\n};\nconst lch = (...args) => new Color(...args, 'lch');\nconst hcl = (...args) => new Color(...args, 'hcl');\nObject.assign(chroma, {\n lch,\n hcl\n});\ninput.format.lch = lch2rgb;\ninput.format.hcl = hcl2rgb;\n['lch', 'hcl'].forEach(m => 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}));\nexport { lch, hcl };","import '../io/lch/index.js';\nimport Color from '../Color.js';\nimport LAB_CONSTANTS from '../io/lab/lab-constants.js';\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};\nColor.prototype.desaturate = function (amount = 1) {\n return this.saturate(-amount);\n};","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\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};","import '../io/lab/index.js';\nimport Color from '../Color.js';\nimport mix from '../generator/mix.js';\nColor.prototype.tint = function (f = 0.5, ...rest) {\n return mix(this, 'white', f, ...rest);\n};\nColor.prototype.shade = function (f = 0.5, ...rest) {\n return mix(this, 'black', f, ...rest);\n};","import Color from '../Color.js';\nimport index from './index.js';\nconst rgb = (col1, col2, f) => {\n const xyz0 = col1._rgb;\n const xyz1 = col2._rgb;\n return new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), 'rgb');\n};\n\n// register interpolator\nindex.rgb = rgb;\nexport default rgb;","import Color from '../Color.js';\nconst {\n sqrt,\n pow\n} = Math;\nimport index from './index.js';\nconst lrgb = (col1, col2, f) => {\n const [x1, y1, z1] = col1._rgb;\n const [x2, y2, z2] = col2._rgb;\n return new Color(sqrt(pow(x1, 2) * (1 - f) + pow(x2, 2) * f), sqrt(pow(y1, 2) * (1 - f) + pow(y2, 2) * f), sqrt(pow(z1, 2) * (1 - f) + pow(z2, 2) * f), 'rgb');\n};\n\n// register interpolator\nindex.lrgb = lrgb;\nexport default lrgb;","import '../io/lab/index.js';\nimport index from './index.js';\nimport Color from '../Color.js';\nconst lab = (col1, col2, f) => {\n const xyz0 = col1.lab();\n const xyz1 = col2.lab();\n return new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), 'lab');\n};\n\n// register interpolator\nindex.lab = lab;\nexport default lab;","import Color from '../Color.js';\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 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 let sat, hue, lbv, dh;\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 if (sat === undefined) sat = sat0 + f * (sat1 - sat0);\n lbv = lbv0 + f * (lbv1 - lbv0);\n return m === 'oklch' ? new Color([lbv, sat, hue], m) : new Color([hue, sat, lbv], m);\n};","import '../io/lch/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\nconst lch = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'lch');\n};\n\n// register interpolator\nindex.lch = lch;\nindex.hcl = lch;\nexport default lch;","import { type } from '../../utils/index.js';\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};\nexport default num2rgb;","import { unpack } from '../../utils/index.js';\nconst rgb2num = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n return (r << 16) + (g << 8) + b;\n};\nexport default rgb2num;","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';\nColor.prototype.num = function () {\n return rgb2num(this._rgb);\n};\nconst num = (...args) => new Color(...args, 'num');\nObject.assign(chroma, {\n num\n});\ninput.format.num = num2rgb;\ninput.autodetect.push({\n p: 5,\n test: (...args) => {\n if (args.length === 1 && type(args[0]) === 'number' && args[0] >= 0 && args[0] <= 0xffffff) {\n return 'num';\n }\n }\n});\nexport { num };","import '../io/num/index.js';\nimport index from './index.js';\nimport Color from '../Color.js';\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;\nexport default num;","import { unpack } from '../../utils/index.js';\nconst {\n floor\n} = 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};\nexport default hcg2rgb;","import { unpack, max, min } from '../../utils/index.js';\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};\nexport default rgb2hcg;","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';\nColor.prototype.hcg = function () {\n return rgb2hcg(this._rgb);\n};\nconst hcg = (...args) => new Color(...args, 'hcg');\nchroma.hcg = hcg;\ninput.format.hcg = hcg2rgb;\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});\nexport { hcg };","import '../io/hcg/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\nconst hcg = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hcg');\n};\n\n// register interpolator\nindex.hcg = hcg;\nexport default hcg;","import { unpack, limit, TWOPI, PITHIRD } from '../../utils/index.js';\nconst {\n cos\n} = 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 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};\nexport default hsi2rgb;","import { unpack, TWOPI } from '../../utils/index.js';\nconst {\n min,\n sqrt,\n acos\n} = Math;\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};\nexport default rgb2hsi;","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';\nColor.prototype.hsi = function () {\n return rgb2hsi(this._rgb);\n};\nconst hsi = (...args) => new Color(...args, 'hsi');\nchroma.hsi = hsi;\ninput.format.hsi = hsi2rgb;\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});\nexport { hsi };","import '../io/hsi/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\nconst hsi = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsi');\n};\n\n// register interpolator\nindex.hsi = hsi;\nexport default hsi;","import { unpack } from '../../utils/index.js';\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];else if (2 * t3[i] < 1) c[i] = t2;else if (3 * t3[i] < 2) c[i] = t1 + (t2 - t1) * (2 / 3 - t3[i]) * 6;else c[i] = t1;\n }\n [r, g, b] = [c[0] * 255, c[1] * 255, 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};\nexport default hsl2rgb;","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 r /= 255;\n g /= 255;\n b /= 255;\n const minRgb = min(r, g, b);\n const maxRgb = max(r, g, b);\n const l = (maxRgb + minRgb) / 2;\n let s, h;\n if (maxRgb === minRgb) {\n s = 0;\n h = Number.NaN;\n } else {\n s = l < 0.5 ? (maxRgb - minRgb) / (maxRgb + minRgb) : (maxRgb - minRgb) / (2 - maxRgb - minRgb);\n }\n if (r == maxRgb) h = (g - b) / (maxRgb - minRgb);else if (g == maxRgb) h = 2 + (b - r) / (maxRgb - minRgb);else if (b == maxRgb) h = 4 + (r - g) / (maxRgb - minRgb);\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};\nexport default rgb2hsl;","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';\nColor.prototype.hsl = function () {\n return rgb2hsl(this._rgb);\n};\nconst hsl = (...args) => new Color(...args, 'hsl');\nchroma.hsl = hsl;\ninput.format.hsl = hsl2rgb;\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});\nexport { hsl };","import '../io/hsl/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\nconst hsl = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsl');\n};\n\n// register interpolator\nindex.hsl = hsl;\nexport default hsl;","import { unpack } from '../../utils/index.js';\nconst {\n floor\n} = Math;\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 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 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};\nexport default hsv2rgb;","import { unpack } from '../../utils/index.js';\nconst {\n min,\n max\n} = 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};\nexport default rgb2hsl;","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';\nColor.prototype.hsv = function () {\n return rgb2hsv(this._rgb);\n};\nconst hsv = (...args) => new Color(...args, 'hsv');\nchroma.hsv = hsv;\ninput.format.hsv = hsv2rgb;\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});\nexport { hsv };","import '../io/hsv/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\nconst hsv = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsv');\n};\n\n// register interpolator\nindex.hsv = hsv;\nexport default hsv;","// from https://www.w3.org/TR/css-color-4/multiply-matrices.js\nexport default function multiplyMatrices(A, B) {\n let m = A.length;\n if (!Array.isArray(A[0])) {\n // A is vector, convert to [[a, b, c, ...]]\n A = [A];\n }\n if (!Array.isArray(B[0])) {\n // B is vector, convert to [[a], [b], [c], ...]]\n B = B.map(x => [x]);\n }\n let p = B[0].length;\n let B_cols = B[0].map((_, i) => B.map(x => x[i])); // transpose B\n let product = A.map(row => B_cols.map(col => {\n if (!Array.isArray(row)) {\n return col.reduce((a, c) => a + c * row, 0);\n }\n return row.reduce((a, c, i) => a + c * (col[i] || 0), 0);\n }));\n if (m === 1) {\n product = product[0]; // Avoid [[a, b, c, ...]]\n }\n if (p === 1) {\n return product.map(x => x[0]); // Avoid [[a], [b], [c], ...]]\n }\n return product;\n}","import { unpack } from '../../utils/index.js';\nimport multiplyMatrices from '../../utils/multiply-matrices.js';\nimport { xyz2rgb } from '../lab/lab2rgb.js';\nconst oklab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b, ...rest] = args;\n const [X, Y, Z] = OKLab_to_XYZ([L, a, b]);\n const [r, g, b_] = xyz2rgb(X, Y, Z);\n return [r, g, b_, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\n// from https://www.w3.org/TR/css-color-4/#color-conversion-code\nfunction OKLab_to_XYZ(OKLab) {\n // Given OKLab, convert to XYZ relative to D65\n var LMStoXYZ = [[1.2268798758459243, -0.5578149944602171, 0.2813910456659647], [-0.0405757452148008, 1.112286803280317, -0.0717110580655164], [-0.0763729366746601, -0.4214933324022432, 1.5869240198367816]];\n var OKLabtoLMS = [[1.0, 0.3963377773761749, 0.2158037573099136], [1.0, -0.1055613458156586, -0.0638541728258133], [1.0, -0.0894841775298119, -1.2914855480194092]];\n var LMSnl = multiplyMatrices(OKLabtoLMS, OKLab);\n return multiplyMatrices(LMStoXYZ, LMSnl.map(c => c ** 3));\n}\nexport default oklab2rgb;","import { unpack } from '../../utils/index.js';\nimport multiplyMatrices from '../../utils/multiply-matrices.js';\nimport { rgb2xyz } from '../lab/rgb2lab.js';\nconst rgb2oklab = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const xyz = rgb2xyz(r, g, b);\n const oklab = XYZ_to_OKLab(xyz);\n return [...oklab, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\n\n// from https://www.w3.org/TR/css-color-4/#color-conversion-code\nfunction XYZ_to_OKLab(XYZ) {\n // Given XYZ relative to D65, convert to OKLab\n const XYZtoLMS = [[0.819022437996703, 0.3619062600528904, -0.1288737815209879], [0.0329836539323885, 0.9292868615863434, 0.0361446663506424], [0.0481771893596242, 0.2642395317527308, 0.6335478284694309]];\n const LMStoOKLab = [[0.210454268309314, 0.7936177747023054, -0.0040720430116193], [1.9779985324311684, -2.4285922420485799, 0.450593709617411], [0.0259040424655478, 0.7827717124575296, -0.8086757549230774]];\n const LMS = multiplyMatrices(XYZtoLMS, XYZ);\n // JavaScript Math.cbrt returns a sign-matched cube root\n // beware if porting to other languages\n // especially if tempted to use a general power function\n return multiplyMatrices(LMStoOKLab, LMS.map(c => Math.cbrt(c)));\n // L in range [0,1]. For use in CSS, multiply by 100 and add a percent\n}\nexport default rgb2oklab;","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';\nColor.prototype.oklab = function () {\n return rgb2oklab(this._rgb);\n};\nconst oklab = (...args) => new Color(...args, 'oklab');\nObject.assign(chroma, {\n oklab\n});\ninput.format.oklab = oklab2rgb;\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'oklab');\n if (type(args) === 'array' && args.length === 3) {\n return 'oklab';\n }\n }\n});\nexport { oklab };","import '../io/oklab/index.js';\nimport index from './index.js';\nimport Color from '../Color.js';\nconst oklab = (col1, col2, f) => {\n const xyz0 = col1.oklab();\n const xyz1 = col2.oklab();\n return new Color(xyz0[0] + f * (xyz1[0] - xyz0[0]), xyz0[1] + f * (xyz1[1] - xyz0[1]), xyz0[2] + f * (xyz1[2] - xyz0[2]), 'oklab');\n};\n\n// register interpolator\nindex.oklab = oklab;\nexport default oklab;","import '../io/lch/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\nconst oklch = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'oklch');\n};\n\n// register interpolator\nindex.oklch = oklch;\nexport default oklch;","import Color from '../Color.js';\nimport { clip_rgb } from '../utils/index.js';\nconst {\n pow,\n sqrt,\n PI,\n cos,\n sin,\n atan2\n} = Math;\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 = l / 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 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 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};\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};","// minimal multi-purpose interface\n\n// @requires utils color analyze\nimport chroma from '../chroma.js';\nimport { limit, type } from '../utils/index.js';\nconst {\n pow\n} = Math;\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 (colors && type(colors) === 'string' && chroma.brewer && chroma.brewer[colors.toLowerCase()]) {\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 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 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 if (!bypassMap) {\n t = tMapLightness(t); // lightness correction\n }\n if (_gamma !== 1) {\n t = pow(t, _gamma);\n }\n t = _padding[0] + t * (1 - _padding[0] - _padding[1]);\n t = limit(t, 0, 1);\n const k = Math.floor(t * 10000);\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(_colors[i], _colors[i + 1], t, _mode);\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 var resetCache = () => _colorCache = {};\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 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 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 = (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 f.mode = function (_m) {\n if (!arguments.length) {\n return _mode;\n }\n _mode = _m;\n resetCache();\n return f;\n };\n f.range = function (colors, _pos) {\n setColors(colors, _pos);\n return f;\n };\n f.out = function (_o) {\n _out = _o;\n return f;\n };\n f.spread = function (val) {\n if (!arguments.length) {\n return _spread;\n }\n _spread = val;\n return f;\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 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 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 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 => f(dm + i / (numColors - 1) * dd));\n } else {\n // returns all colors based on the defined classes\n colors = [];\n let samples = [];\n if (_classes && _classes.length > 2) {\n for (let i = 1, end = _classes.length, asc = 1 <= end; asc ? i < end : i > end; asc ? i++ : i--) {\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 if (chroma[out]) {\n result = result.map(c => c[out]());\n }\n return result;\n };\n f.cache = function (c) {\n if (c != null) {\n _useCache = c;\n return f;\n } else {\n return _useCache;\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 f.nodata = function (d) {\n if (d != null) {\n _nacol = chroma(d);\n return f;\n } else {\n return _nacol;\n }\n };\n return f;\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// 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};\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(i => (1 - t) * (1 - t) * lab0[i] + 2 * (1 - t) * t * lab1[i] + t * t * lab2[i]);\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(i => (1 - t) * (1 - t) * (1 - t) * lab0[i] + 3 * (1 - t) * (1 - t) * t * lab1[i] + 3 * (1 - t) * t * t * lab2[i] + t * t * t * lab3[i]);\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 => labs.reduce((sum, el, j) => sum + row[j] * u ** (n - j) * t ** j * el[i], 0));\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};\nexport default colors => {\n const f = bezier(colors);\n f.scale = () => scale(f);\n return f;\n};","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { unpack, type } from '../../utils/index.js';\nconst {\n round\n} = Math;\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};\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};\nconst rgb = (...args) => new Color(...args, 'rgb');\nObject.assign(chroma, {\n rgb\n});\ninput.format.rgb = (...args) => {\n const rgba = unpack(args, 'rgba');\n if (rgba[3] === undefined) rgba[3] = 1;\n return rgba;\n};\ninput.autodetect.push({\n p: 3,\n test: (...args) => {\n args = unpack(args, 'rgba');\n if (type(args) === 'array' && (args.length === 3 || args.length === 4 && type(args[3]) == 'number' && args[3] >= 0 && args[3] <= 1)) {\n return 'rgb';\n }\n }\n});\nexport { rgb };","/*\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';\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};\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};\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};\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) => 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;","// 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 {\n pow,\n sin,\n cos\n} = Math;\nexport default function (start = 300, rotations = -1.5, hue = 1, gamma = 1, lightness = [0, 1]) {\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}","import Color from '../Color.js';\nconst digits = '0123456789abcdef';\nconst {\n floor,\n random\n} = Math;\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};","import type from './type.js';\nconst {\n log,\n pow,\n floor,\n abs\n} = Math;\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 r.domain = [r.min, r.max];\n r.limits = (mode, num) => limits(r, mode, num);\n return r;\n}\nexport function limits(data, mode = 'equal', num = 7) {\n if (type(data) == 'array') {\n data = analyze(data);\n }\n const {\n min,\n max\n } = data;\n const values = data.values.sort((a, b) => a - b);\n if (num === 1) {\n return [min, max];\n }\n const limits = [];\n if (mode.substr(0, 1) === 'c') {\n // continuous\n limits.push(min);\n limits.push(max);\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('Logarithmic scales are only possible for values > 0');\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 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 centroids = newCentroids;\n nb_iters++;\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}","import Color from '../Color.js';\nimport '../ops/luminance.js';\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};","import Color from '../Color.js';\nimport mix from '../generator/mix.js';\n\n/**\n * @license\n *\n * The APCA contrast prediction algorithm is based of the formulas published\n * in the APCA-1.0.98G specification by Myndex. The specification is available at:\n * https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg\n *\n * Note that the APCA implementation is still beta, so please update to\n * future versions of chroma.js when they become available.\n *\n * You can read more about the APCA Readability Criterion at\n * https://readtech.org/ARC/\n */\n\n// constants\nconst W_offset = 0.027;\nconst P_in = 0.0005;\nconst P_out = 0.1;\nconst R_scale = 1.14;\nconst B_threshold = 0.022;\nconst B_exp = 1.414;\nexport default (text, bg) => {\n // parse input colors\n text = new Color(text);\n bg = new Color(bg);\n // if text color has alpha, blend against background\n if (text.alpha() < 1) {\n text = mix(bg, text, text.alpha(), 'rgb');\n }\n const l_text = lum(...text.rgb());\n const l_bg = lum(...bg.rgb());\n\n // soft clamp black levels\n const Y_text = l_text >= B_threshold ? l_text : l_text + Math.pow(B_threshold - l_text, B_exp);\n const Y_bg = l_bg >= B_threshold ? l_bg : l_bg + Math.pow(B_threshold - l_bg, B_exp);\n\n // normal polarity (dark text on light background)\n const S_norm = Math.pow(Y_bg, 0.56) - Math.pow(Y_text, 0.57);\n // reverse polarity (light text on dark background)\n const S_rev = Math.pow(Y_bg, 0.65) - Math.pow(Y_text, 0.62);\n // clamp noise then scale\n const C = Math.abs(Y_bg - Y_text) < P_in ? 0 : Y_text < Y_bg ? S_norm * R_scale : S_rev * R_scale;\n // clamp minimum contrast then offset\n const S_apc = Math.abs(C) < P_out ? 0 : C > 0 ? C - W_offset : C + W_offset;\n // scale to 100\n return S_apc * 100;\n};\nfunction lum(r, g, b) {\n return 0.2126729 * Math.pow(r / 255, 2.4) + 0.7151522 * Math.pow(g / 255, 2.4) + 0.072175 * Math.pow(b / 255, 2.4);\n}","import Color from '../Color.js';\nconst {\n sqrt,\n pow,\n min,\n max,\n atan2,\n abs,\n cos,\n sin,\n exp,\n PI\n} = Math;\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 = abs(h1p - h2p) > 180 ? (h1p + h2p + 360) / 2 : (h1p + h2p) / 2;\n const T = 1 - 0.17 * cos(deg2rad(avgHp - 30)) + 0.24 * cos(deg2rad(2 * avgHp)) + 0.32 * cos(deg2rad(3 * avgHp + 6)) - 0.2 * cos(deg2rad(4 * avgHp - 63));\n let deltaHp = h2p - h1p;\n deltaHp = abs(deltaHp) <= 180 ? deltaHp : h2p <= h1p ? deltaHp + 360 : 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(pow(deltaL / (Kl * sl), 2) + pow(deltaCp / (Kc * sc), 2) + pow(deltaHp / (Kh * sh), 2) + Rt * (deltaCp / (Kc * sc)) * (deltaHp / (Kh * sh)));\n return max(0, min(100, result));\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}","import Color from '../Color.js';\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};","// some pre-defined color scales:\nimport chroma from '../chroma.js';\nimport '../io/hsl/index.js';\nimport scale from '../generator/scale.js';\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('rgb');\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 // 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 // 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};\nconst colorbrewerTypes = Object.keys(colorbrewer);\nconst typeMap = new Map(colorbrewerTypes.map(key => [key.toLowerCase(), key]));\n\n// use Proxy to allow case-insensitive access to palettes\nconst colorbrewerProxy = typeof Proxy === 'function' ? new Proxy(colorbrewer, {\n get(target, prop) {\n const lower = prop.toLowerCase();\n if (typeMap.has(lower)) {\n return target[typeMap.get(lower)];\n }\n },\n getOwnPropertyNames() {\n return Object.getOwnPropertyNames(colorbrewerTypes);\n }\n}) : colorbrewer;\nexport default colorbrewerProxy;","import { unpack } from '../../utils/index.js';\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 [c >= 1 ? 0 : 255 * (1 - c) * (1 - k),\n // r\n m >= 1 ? 0 : 255 * (1 - m) * (1 - k),\n // g\n y >= 1 ? 0 : 255 * (1 - y) * (1 - k),\n // b\n alpha];\n};\nexport default cmyk2rgb;","import { unpack } from '../../utils/index.js';\nconst {\n max\n} = Math;\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};\nexport default rgb2cmyk;","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';\nColor.prototype.cmyk = function () {\n return rgb2cmyk(this._rgb);\n};\nconst cmyk = (...args) => new Color(...args, 'cmyk');\nObject.assign(chroma, {\n cmyk\n});\ninput.format.cmyk = cmyk2rgb;\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});\nexport { cmyk };","import { unpack, last, rnd2 } from '../../utils/index.js';\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] = rnd2(hsla[0] || 0) + 'deg';\n hsla[1] = rnd2(hsla[1] * 100) + '%';\n hsla[2] = rnd2(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.substr(0, 3)}(${hsla.join(' ')})`;\n};\nexport default hsl2css;","import { unpack, last, rnd2 } from '../../utils/index.js';\n\n/*\n * supported arguments:\n * - lab2css(l,a,b)\n * - lab2css(l,a,b,alpha)\n * - lab2css([l,a,b], mode)\n * - lab2css([l,a,b,alpha], mode)\n */\nconst lab2css = (...args) => {\n const laba = unpack(args, 'lab');\n let mode = last(args) || 'lab';\n laba[0] = rnd2(laba[0]) + '%';\n laba[1] = rnd2(laba[1]);\n laba[2] = rnd2(laba[2]);\n if (mode === 'laba' || laba.length > 3 && laba[3] < 1) {\n laba[3] = '/ ' + (laba.length > 3 ? laba[3] : 1);\n } else {\n laba.length = 3;\n }\n return `lab(${laba.join(' ')})`;\n};\nexport default lab2css;","import { unpack, last, rnd2 } from '../../utils/index.js';\n\n/*\n * supported arguments:\n * - lab2css(l,a,b)\n * - lab2css(l,a,b,alpha)\n * - lab2css([l,a,b], mode)\n * - lab2css([l,a,b,alpha], mode)\n */\nconst lch2css = (...args) => {\n const lcha = unpack(args, 'lch');\n let mode = last(args) || 'lab';\n lcha[0] = rnd2(lcha[0]) + '%';\n lcha[1] = rnd2(lcha[1]);\n lcha[2] = isNaN(lcha[2]) ? 'none' : rnd2(lcha[2]) + 'deg'; // add deg unit to hue\n if (mode === 'lcha' || lcha.length > 3 && lcha[3] < 1) {\n lcha[3] = '/ ' + (lcha.length > 3 ? lcha[3] : 1);\n } else {\n lcha.length = 3;\n }\n return `lch(${lcha.join(' ')})`;\n};\nexport default lch2css;","import { unpack, rnd2, rnd3 } from '../../utils/index.js';\nconst oklab2css = (...args) => {\n const laba = unpack(args, 'lab');\n laba[0] = rnd2(laba[0] * 100) + '%';\n laba[1] = rnd3(laba[1]);\n laba[2] = rnd3(laba[2]);\n if (laba.length > 3 && laba[3] < 1) {\n laba[3] = '/ ' + (laba.length > 3 ? laba[3] : 1);\n } else {\n laba.length = 3;\n }\n return `oklab(${laba.join(' ')})`;\n};\nexport default oklab2css;","import { unpack } from '../../utils/index.js';\nimport rgb2oklab from '../oklab/rgb2oklab.js';\nimport lab2lch from '../lch/lab2lch.js';\nconst rgb2oklch = (...args) => {\n const [r, g, b, ...rest] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2oklab(r, g, b);\n const [L, c, h] = lab2lch(l, a, b_);\n return [L, c, h, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\nexport default rgb2oklch;","import { unpack, rnd2, rnd3 } from '../../utils/index.js';\nconst oklch2css = (...args) => {\n const lcha = unpack(args, 'lch');\n lcha[0] = rnd2(lcha[0] * 100) + '%';\n lcha[1] = rnd3(lcha[1]);\n lcha[2] = isNaN(lcha[2]) ? 'none' : rnd2(lcha[2]) + 'deg'; // add deg unit to hue\n if (lcha.length > 3 && lcha[3] < 1) {\n lcha[3] = '/ ' + (lcha.length > 3 ? lcha[3] : 1);\n } else {\n lcha.length = 3;\n }\n return `oklch(${lcha.join(' ')})`;\n};\nexport default oklch2css;","import { unpack, last } from '../../utils/index.js';\nimport hsl2css from './hsl2css.js';\nimport rgb2hsl from '../hsl/rgb2hsl.js';\nimport lab2css from './lab2css.js';\nimport rgb2lab from '../lab/rgb2lab.js';\nimport lch2css from './lch2css.js';\nimport rgb2lch from '../lch/rgb2lch.js';\nimport rgb2oklab from '../oklab/rgb2oklab.js';\nimport oklab2css from './oklab2css.js';\nimport rgb2oklch from '../oklch/rgb2oklch.js';\nimport oklch2css from './oklch2css.js';\nimport { getLabWhitePoint, setLabWhitePoint } from '../lab/lab-constants.js';\nconst {\n round\n} = 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 if (mode.substr(0, 3) === 'lab') {\n // change to D50 lab whitepoint since this is what W3C is using for CSS Lab colors\n const prevWhitePoint = getLabWhitePoint();\n setLabWhitePoint('d50');\n const cssColor = lab2css(rgb2lab(rgba), mode);\n setLabWhitePoint(prevWhitePoint);\n return cssColor;\n }\n if (mode.substr(0, 3) === 'lch') {\n // change to D50 lab whitepoint since this is what W3C is using for CSS Lab colors\n const prevWhitePoint = getLabWhitePoint();\n setLabWhitePoint('d50');\n const cssColor = lch2css(rgb2lch(rgba), mode);\n setLabWhitePoint(prevWhitePoint);\n return cssColor;\n }\n if (mode.substr(0, 5) === 'oklab') {\n return oklab2css(rgb2oklab(rgba));\n }\n if (mode.substr(0, 5) === 'oklch') {\n return oklch2css(rgb2oklch(rgba));\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.substr(0, 3)}(${rgba.slice(0, mode === 'rgb' ? 3 : 4).join(' ')})`;\n};\nexport default rgb2css;","import { unpack } from '../../utils/index.js';\nimport lch2lab from '../lch/lch2lab.js';\nimport oklab2rgb from '../oklab/oklab2rgb.js';\nconst oklch2rgb = (...args) => {\n args = unpack(args, 'lch');\n const [l, c, h, ...rest] = args;\n const [L, a, b_] = lch2lab(l, c, h);\n const [r, g, b] = oklab2rgb(L, a, b_);\n return [r, g, b, ...(rest.length > 0 && rest[0] < 1 ? [rest[0]] : [])];\n};\nexport default oklch2rgb;","import hsl2rgb from '../hsl/hsl2rgb.js';\nimport lab2rgb from '../lab/lab2rgb.js';\nimport lch2rgb from '../lch/lch2rgb.js';\nimport oklab2rgb from '../oklab/oklab2rgb.js';\nimport oklch2rgb from '../oklch/oklch2rgb.js';\nimport input from '../input.js';\nimport limit from '../../utils/limit.js';\nimport { getLabWhitePoint, setLabWhitePoint } from '../lab/lab-constants.js';\nconst INT_OR_PCT = /((?:-?\\d+)|(?:-?\\d+(?:\\.\\d+)?)%|none)/.source;\nconst FLOAT_OR_PCT = /((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%?)|none)/.source;\nconst PCT = /((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)%)|none)/.source;\nconst RE_S = /\\s*/.source;\nconst SEP = /\\s+/.source;\nconst COMMA = /\\s*,\\s*/.source;\nconst ANLGE = /((?:-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:deg)?)|none)/.source;\nconst ALPHA = /\\s*(?:\\/\\s*((?:[01]|[01]?\\.\\d+)|\\d+(?:\\.\\d+)?%))?/.source;\n\n// e.g. rgb(250 20 0), rgb(100% 50% 20%), rgb(100% 50% 20% / 0.5)\nconst RE_RGB = new RegExp('^rgba?\\\\(' + RE_S + [INT_OR_PCT, INT_OR_PCT, INT_OR_PCT].join(SEP) + ALPHA + '\\\\)$');\nconst RE_RGB_LEGACY = new RegExp('^rgb\\\\(' + RE_S + [INT_OR_PCT, INT_OR_PCT, INT_OR_PCT].join(COMMA) + RE_S + '\\\\)$');\nconst RE_RGBA_LEGACY = new RegExp('^rgba\\\\(' + RE_S + [INT_OR_PCT, INT_OR_PCT, INT_OR_PCT, FLOAT_OR_PCT].join(COMMA) + RE_S + '\\\\)$');\nconst RE_HSL = new RegExp('^hsla?\\\\(' + RE_S + [ANLGE, PCT, PCT].join(SEP) + ALPHA + '\\\\)$');\nconst RE_HSL_LEGACY = new RegExp('^hsl?\\\\(' + RE_S + [ANLGE, PCT, PCT].join(COMMA) + RE_S + '\\\\)$');\nconst RE_HSLA_LEGACY = /^hsla\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\nconst RE_LAB = new RegExp('^lab\\\\(' + RE_S + [FLOAT_OR_PCT, FLOAT_OR_PCT, FLOAT_OR_PCT].join(SEP) + ALPHA + '\\\\)$');\nconst RE_LCH = new RegExp('^lch\\\\(' + RE_S + [FLOAT_OR_PCT, FLOAT_OR_PCT, ANLGE].join(SEP) + ALPHA + '\\\\)$');\nconst RE_OKLAB = new RegExp('^oklab\\\\(' + RE_S + [FLOAT_OR_PCT, FLOAT_OR_PCT, FLOAT_OR_PCT].join(SEP) + ALPHA + '\\\\)$');\nconst RE_OKLCH = new RegExp('^oklch\\\\(' + RE_S + [FLOAT_OR_PCT, FLOAT_OR_PCT, ANLGE].join(SEP) + ALPHA + '\\\\)$');\nconst {\n round\n} = Math;\nconst roundRGB = rgb => {\n return rgb.map((v, i) => i <= 2 ? limit(round(v), 0, 255) : v);\n};\nconst percentToAbsolute = (pct, min = 0, max = 100, signed = false) => {\n if (typeof pct === 'string' && pct.endsWith('%')) {\n pct = parseFloat(pct.substring(0, pct.length - 1)) / 100;\n if (signed) {\n // signed percentages are in the range -100% to 100%\n pct = min + (pct + 1) * 0.5 * (max - min);\n } else {\n pct = min + pct * (max - min);\n }\n }\n return +pct;\n};\nconst noneToValue = (v, noneValue) => {\n return v === 'none' ? noneValue : v;\n};\nconst css2rgb = css => {\n css = css.toLowerCase().trim();\n if (css === 'transparent') {\n return [0, 0, 0, 0];\n }\n let m;\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) or rgb(250,20,0)\n if ((m = css.match(RE_RGB)) || (m = css.match(RE_RGB_LEGACY))) {\n let rgb = m.slice(1, 4);\n for (let i = 0; i < 3; i++) {\n rgb[i] = +percentToAbsolute(noneToValue(rgb[i], 0), 0, 255);\n }\n rgb = roundRGB(rgb);\n const alpha = m[4] !== undefined ? +percentToAbsolute(m[4], 0, 1) : 1;\n rgb[3] = alpha; // default alpha\n return rgb;\n }\n\n // rgba(250,20,0,0.4)\n if (m = css.match(RE_RGBA_LEGACY)) {\n const rgb = m.slice(1, 5);\n for (let i = 0; i < 4; i++) {\n rgb[i] = +percentToAbsolute(rgb[i], 0, 255);\n }\n return rgb;\n }\n\n // hsl(0,100%,50%)\n if ((m = css.match(RE_HSL)) || (m = css.match(RE_HSL_LEGACY))) {\n const hsl = m.slice(1, 4);\n hsl[0] = +noneToValue(hsl[0].replace('deg', ''), 0);\n hsl[1] = +percentToAbsolute(noneToValue(hsl[1], 0), 0, 100) * 0.01;\n hsl[2] = +percentToAbsolute(noneToValue(hsl[2], 0), 0, 100) * 0.01;\n const rgb = roundRGB(hsl2rgb(hsl));\n const alpha = m[4] !== undefined ? +percentToAbsolute(m[4], 0, 1) : 1;\n rgb[3] = alpha;\n return rgb;\n }\n\n // hsla(0,100%,50%,0.5)\n if (m = css.match(RE_HSLA_LEGACY)) {\n const hsl = m.slice(1, 4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n const rgb = hsl2rgb(hsl);\n for (let i = 0; i < 3; i++) {\n rgb[i] = round(rgb[i]);\n }\n rgb[3] = +m[4]; // default alpha = 1\n return rgb;\n }\n if (m = css.match(RE_LAB)) {\n const lab = m.slice(1, 4);\n lab[0] = percentToAbsolute(noneToValue(lab[0], 0), 0, 100);\n lab[1] = percentToAbsolute(noneToValue(lab[1], 0), -125, 125, true);\n lab[2] = percentToAbsolute(noneToValue(lab[2], 0), -125, 125, true);\n // convert to D50 Lab whitepoint\n const wp = getLabWhitePoint();\n setLabWhitePoint('d50');\n const rgb = roundRGB(lab2rgb(lab));\n // convert back to original Lab whitepoint\n setLabWhitePoint(wp);\n const alpha = m[4] !== undefined ? +percentToAbsolute(m[4], 0, 1) : 1;\n rgb[3] = alpha;\n return rgb;\n }\n if (m = css.match(RE_LCH)) {\n const lch = m.slice(1, 4);\n lch[0] = percentToAbsolute(lch[0], 0, 100);\n lch[1] = percentToAbsolute(noneToValue(lch[1], 0), 0, 150, false);\n lch[2] = +noneToValue(lch[2].replace('deg', ''), 0);\n // convert to D50 Lab whitepoint\n const wp = getLabWhitePoint();\n setLabWhitePoint('d50');\n const rgb = roundRGB(lch2rgb(lch));\n // convert back to original Lab whitepoint\n setLabWhitePoint(wp);\n const alpha = m[4] !== undefined ? +percentToAbsolute(m[4], 0, 1) : 1;\n rgb[3] = alpha;\n return rgb;\n }\n if (m = css.match(RE_OKLAB)) {\n const oklab = m.slice(1, 4);\n oklab[0] = percentToAbsolute(noneToValue(oklab[0], 0), 0, 1);\n oklab[1] = percentToAbsolute(noneToValue(oklab[1], 0), -0.4, 0.4, true);\n oklab[2] = percentToAbsolute(noneToValue(oklab[2], 0), -0.4, 0.4, true);\n const rgb = roundRGB(oklab2rgb(oklab));\n const alpha = m[4] !== undefined ? +percentToAbsolute(m[4], 0, 1) : 1;\n rgb[3] = alpha;\n return rgb;\n }\n if (m = css.match(RE_OKLCH)) {\n const oklch = m.slice(1, 4);\n oklch[0] = percentToAbsolute(noneToValue(oklch[0], 0), 0, 1);\n oklch[1] = percentToAbsolute(noneToValue(oklch[1], 0), 0, 0.4, false);\n oklch[2] = +noneToValue(oklch[2].replace('deg', ''), 0);\n const rgb = roundRGB(oklch2rgb(oklch));\n const alpha = m[4] !== undefined ? +percentToAbsolute(m[4], 0, 1) : 1;\n rgb[3] = alpha;\n return rgb;\n }\n};\ncss2rgb.test = s => {\n return (\n // modern\n RE_RGB.test(s) || RE_HSL.test(s) || RE_LAB.test(s) || RE_LCH.test(s) || RE_OKLAB.test(s) || RE_OKLCH.test(s) ||\n // legacy\n RE_RGB_LEGACY.test(s) || RE_RGBA_LEGACY.test(s) || RE_HSL_LEGACY.test(s) || RE_HSLA_LEGACY.test(s) || s === 'transparent'\n );\n};\nexport default css2rgb;","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { type } from '../../utils/index.js';\nimport rgb2css from './rgb2css.js';\nimport css2rgb from './css2rgb.js';\nColor.prototype.css = function (mode) {\n return rgb2css(this._rgb, mode);\n};\nconst css = (...args) => new Color(...args, 'css');\nchroma.css = css;\ninput.format.css = css2rgb;\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});\nexport { css };","import Color from '../../Color.js';\nimport chroma from '../../chroma.js';\nimport input from '../input.js';\nimport { unpack } from '../../utils/index.js';\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};\nconst gl = (...args) => new Color(...args, 'gl');\nchroma.gl = gl;\nColor.prototype.gl = function () {\n const rgb = this._rgb;\n return [rgb[0] / 255, rgb[1] / 255, rgb[2] / 255, rgb[3]];\n};\nexport { gl };","import Color from '../../Color.js';\nimport chroma from '../../chroma.js';\nimport { type } from '../../utils/index.js';\nimport input from '../input.js';\nimport hex2rgb from './hex2rgb.js';\nimport rgb2hex from './rgb2hex.js';\nColor.prototype.hex = function (mode) {\n return rgb2hex(this._rgb, mode);\n};\nconst hex = (...args) => new Color(...args, 'hex');\nchroma.hex = hex;\ninput.format.hex = hex2rgb;\ninput.autodetect.push({\n p: 4,\n test: (h, ...rest) => {\n if (!rest.length && type(h) === 'string' && [3, 4, 5, 6, 7, 8, 9].indexOf(h.length) >= 0) {\n return 'hex';\n }\n }\n});\nexport { hex };","/*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n */\n\nconst {\n log\n} = Math;\nconst temperature2rgb = kelvin => {\n const temp = kelvin / 100;\n let r, g, b;\n if (temp < 66) {\n r = 255;\n g = temp < 6 ? 0 : -155.25485562709179 - 0.44596950469579133 * (g = temp - 2) + 104.49216199393888 * log(g);\n b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp - 10) + 115.67994401066147 * log(b);\n } else {\n r = 351.97690566805693 + 0.114206453784165 * (r = temp - 55) - 40.25366309332127 * log(r);\n g = 325.4494125711974 + 0.07943456536662342 * (g = temp - 50) - 28.0852963507957 * log(g);\n b = 255;\n }\n return [r, g, b, 1];\n};\nexport default temperature2rgb;","/*\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 {\n round\n} = Math;\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};\nexport default rgb2temperature;","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';\nColor.prototype.temp = Color.prototype.kelvin = Color.prototype.temperature = function () {\n return rgb2temperature(this._rgb);\n};\nconst temp = (...args) => new Color(...args, 'temp');\nObject.assign(chroma, {\n temp,\n kelvin: temp,\n temperature: temp\n});\ninput.format.temp = input.format.kelvin = input.format.temperature = temperature2rgb;\nexport { temp, temp as kelvin, temp as temperature };","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';\nColor.prototype.oklch = function () {\n return rgb2oklch(this._rgb);\n};\nconst oklch = (...args) => new Color(...args, 'oklch');\nObject.assign(chroma, {\n oklch\n});\ninput.format.oklch = oklch2rgb;\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'oklch');\n if (type(args) === 'array' && args.length === 3) {\n return 'oklch';\n }\n }\n});\nexport { oklch };","// feel free to comment out anything to rollup\n// a smaller chroma.js bundle\nimport chroma from './src/chroma.js';\n\n// io --> convert colors\nimport './src/io/named/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 contrastAPCA from './src/utils/contrastAPCA.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';\nimport Color from './src/Color.js';\nObject.assign(chroma, {\n analyze,\n average,\n bezier,\n blend,\n brewer,\n Color,\n colors,\n contrast,\n contrastAPCA,\n cubehelix,\n deltaE,\n distance,\n input,\n interpolate: mix,\n limits,\n mix,\n random,\n scale,\n scales,\n valid\n});\nexport default chroma;\nexport { analyze, average, bezier, blend, brewer, Color, colors, contrast, contrastAPCA, cubehelix, deltaE, distance, input, limits, mix, mix as interpolate, random, scale, scales, valid };\nexport * from './src/io/cmyk/index.js';\nexport * from './src/io/css/index.js';\nexport * from './src/io/gl/index.js';\nexport * from './src/io/hcg/index.js';\nexport * from './src/io/hex/index.js';\nexport * from './src/io/hsi/index.js';\nexport * from './src/io/hsl/index.js';\nexport * from './src/io/hsv/index.js';\nexport * from './src/io/lab/index.js';\nexport * from './src/io/lch/index.js';\nexport * from './src/io/num/index.js';\nexport * from './src/io/rgb/index.js';\nexport * from './src/io/temp/index.js';\nexport * from './src/io/oklab/index.js';\nexport * from './src/io/oklch/index.js';"],"names":["min","max","limit_default","x","low","high","clip_rgb_default","rgb","i","limit_default","classToType","name","type_default","obj","unpack_default","args","keyOrder","type_default","k","last_default","args","l","type_default","PI","min","max","rnd2","a","rnd3","TWOPI","PITHIRD","DEG2RAD","RAD2DEG","reverse3","arr","input_default","Color","args","me","type_default","mode","last_default","autodetect","input_default","a","b","chk","rgb","clip_rgb_default","Color_default","version","chroma","args","Color_default","version","chroma_default","w3cx11","w3cx11_default","RE_HEX","RE_HEXA","hex2rgb","hex","u","r","g","b","a","hex2rgb_default","round","rgb2hex","args","g","b","a","unpack_default","mode","last_default","str","hxa","rgb2hex_default","Color_default","hex","rgb2hex_default","n","w3cx11_default","input_default","name","hex2rgb_default","h","rest","type_default","Color_default","a","mutate","type_default","Color_default","labConstants","lab_constants_default","ILLUMINANTS","setLabWhitePoint","name","ill","getLabWhitePoint","lab2rgb","args","unpack_default","L","a","b","x","y","z","lab2xyz","r","g","b_","xyz2rgb","kE","kK","kKE","Xn","Yn","Zn","lab_constants_default","fy","fx","fz","fx3","fz3","xr","yr","zr","compand","linear","sign","MtxAdaptMa","MtxAdaptMaI","MtxXYZ2RGB","RefWhiteRGB","As","Bs","Cs","Ad","Bd","Cd","X1","Y1","Z1","X2","Y2","Z2","lab2rgb_default","rgb2lab","args","g","b","rest","unpack_default","x","y","z","rgb2xyz","L","a","b_","xyz2lab","Xn","Yn","Zn","kE","kK","lab_constants_default","xr","yr","zr","fx","fy","fz","gammaAdjustSRGB","companded","sign","r","MtxRGB2XYZ","MtxAdaptMa","MtxAdaptMaI","As","Bs","Cs","Ad","Bd","Cd","X","Y","Z","rgb2lab_default","Color_default","rgb2lab_default","lab","args","chroma_default","getLabWhitePoint","setLabWhitePoint","input_default","lab2rgb_default","unpack_default","type_default","Color_default","amount","me","lab","lab_constants_default","Color_default","mc","mode","channel","src","i","pow","EPS","MAX_ITER","Color_default","lum","mode","type_default","cur_lum","max_iter","test","low","high","mid","lm","rgb","rgb2luminance","r","g","b","luminance_x","x","interpolator_default","mix_default","col1","col2","f","rest","mode","interpolator_default","type_default","Color_default","Color_default","col2","f","rest","mix_default","Color_default","mutate","rgb","a","sin","cos","lch2lab","args","l","c","h","unpack_default","DEG2RAD","lch2lab_default","lch2rgb","args","unpack_default","l","c","h","L","a","b_","lch2lab_default","r","g","b","lab2rgb_default","lch2rgb_default","hcl2rgb","args","hcl","reverse3","unpack_default","lch2rgb_default","hcl2rgb_default","sqrt","atan2","round","lab2lch","args","l","a","b","unpack_default","c","h","RAD2DEG","lab2lch_default","rgb2lch","args","g","b","rest","unpack_default","l","a","b_","rgb2lab_default","L","c","h","lab2lch_default","rgb2lch_default","Color_default","rgb2lch_default","reverse3","lch","args","hcl","chroma_default","input_default","lch2rgb_default","hcl2rgb_default","m","unpack_default","type_default","Color_default","amount","me","lch","lab_constants_default","Color_default","mc","value","mutate","mode","channel","src","i","type_default","out","Color_default","f","rest","mix_default","rgb","col1","col2","f","xyz0","xyz1","Color_default","interpolator_default","sqrt","pow","lrgb","col1","col2","f","x1","y1","z1","x2","y2","z2","Color_default","interpolator_default","lab","col1","col2","f","xyz0","xyz1","Color_default","interpolator_default","hsx_default","col1","col2","f","m","xyz0","xyz1","hue0","hue1","sat0","sat1","lbv0","lbv1","sat","hue","lbv","dh","Color_default","lch","col1","col2","f","hsx_default","interpolator_default","num2rgb","num","type_default","g","b","num2rgb_default","rgb2num","args","g","b","unpack_default","rgb2num_default","Color_default","rgb2num_default","num","args","chroma_default","input_default","num2rgb_default","type_default","num","col1","col2","f","c1","c2","Color_default","interpolator_default","floor","hcg2rgb","args","unpack_default","h","c","_g","r","g","b","_c","i","f","q","t","v","hcg2rgb_default","rgb2hcg","args","g","b","unpack_default","minRgb","min","maxRgb","max","delta","c","_g","h","rgb2hcg_default","Color_default","rgb2hcg_default","hcg","args","chroma_default","input_default","hcg2rgb_default","unpack_default","type_default","hcg","col1","col2","f","hsx_default","interpolator_default","cos","hsi2rgb","args","unpack_default","h","s","i","r","g","b","TWOPI","PITHIRD","limit_default","hsi2rgb_default","min","sqrt","acos","rgb2hsi","args","g","b","unpack_default","h","min_","i","s","TWOPI","rgb2hsi_default","Color_default","rgb2hsi_default","hsi","args","chroma_default","input_default","hsi2rgb_default","unpack_default","type_default","hsi","col1","col2","f","hsx_default","interpolator_default","hsl2rgb","args","unpack_default","h","s","l","r","g","b","t3","c","t2","t1","h_","i","hsl2rgb_default","rgb2hsl","args","unpack_default","g","b","minRgb","min","maxRgb","max","l","s","h","rgb2hsl_default","Color_default","rgb2hsl_default","hsl","args","chroma_default","input_default","hsl2rgb_default","unpack_default","type_default","hsl","col1","col2","f","hsx_default","interpolator_default","floor","hsv2rgb","args","unpack_default","h","s","v","r","g","b","f","p","q","t","hsv2rgb_default","min","max","rgb2hsl","args","unpack_default","g","b","min_","max_","delta","h","s","v","rgb2hsv_default","Color_default","rgb2hsv_default","hsv","args","chroma_default","input_default","hsv2rgb_default","unpack_default","type_default","hsv","col1","col2","f","hsx_default","interpolator_default","multiplyMatrices","A","B","m","x","p","B_cols","_","product","row","col","c","i","oklab2rgb","args","unpack_default","L","a","b","rest","X","Y","Z","OKLab_to_XYZ","r","g","b_","xyz2rgb","OKLab","LMStoXYZ","OKLabtoLMS","LMSnl","multiplyMatrices","c","oklab2rgb_default","rgb2oklab","args","g","b","rest","unpack_default","xyz","rgb2xyz","XYZ_to_OKLab","XYZ","XYZtoLMS","LMStoOKLab","LMS","multiplyMatrices","c","rgb2oklab_default","Color_default","rgb2oklab_default","oklab","args","chroma_default","input_default","oklab2rgb_default","unpack_default","type_default","oklab","col1","col2","f","xyz0","xyz1","Color_default","interpolator_default","oklch","col1","col2","f","hsx_default","interpolator_default","pow","sqrt","PI","cos","sin","atan2","average_default","colors","mode","weights","l","k","a","w","i","c","Color_default","_average_lrgb","first","xyz","cnt","dx","dy","A","alpha","ci","xyz2","col","f","rgb","clip_rgb_default","pow","scale_default","colors","_mode","_nacol","chroma_default","_spread","_domain","_pos","_padding","_classes","_colors","_out","_min","_max","_correctLightness","_colorCache","_useCache","_gamma","setColors","type_default","c","resetCache","getClass","value","n","i","tMapLightness","t","tMapDomain","getColor","val","bypassMap","col","limit_default","k","p","f","v","classes","d","domain","tOut","tBreaks","_m","_o","L0","L1","pol","L_actual","L_ideal","L_diff","t0","t1","max_iter","numColors","out","result","dm","dd","__range__","samples","end","asc","g","left","right","inclusive","range","ascending","binom_row","n","row","i","newrow","j","bezier","colors","I","lab0","lab1","lab2","c","Color_default","t","lab","lab3","labs","u","sum","el","bezier_default","f","scale_default","round","Color_default","rnd","v","i","rgb","args","chroma_default","input_default","rgba","unpack_default","type_default","blend","bottom","top","mode","blend_f","f","c0","chroma_default","c1","each","out","normal","a","multiply","b","darken","lighten","screen","overlay","burn","dodge","blend_default","pow","sin","cos","cubehelix_default","start","rotations","hue","gamma","lightness","dh","dl","type_default","f","fract","a","TWOPI","l","amp","cos_a","sin_a","r","g","b","chroma_default","clip_rgb_default","s","h","digits","floor","random","random_default","code","i","Color_default","log","pow","floor","abs","analyze","data","key","r","type_default","val","mode","num","limits","min","max","values","a","b","min_log","max_log","i","p","pb","pr","cluster","n","assignments","clusterSizes","repeat","nb_iters","centroids","j","value","mindist","best","dist","newCentroids","kClusters","tmpKMeansBreaks","v","contrast_default","a","b","Color_default","l1","l2","W_offset","P_in","P_out","R_scale","B_threshold","B_exp","contrastAPCA_default","text","bg","Color_default","mix_default","l_text","lum","l_bg","Y_text","Y_bg","S_norm","S_rev","C","r","g","b","sqrt","pow","min","max","atan2","abs","cos","sin","exp","PI","delta_e_default","a","b","Kl","Kc","Kh","rad2deg","rad","deg2rad","deg","Color_default","L1","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","Rt","result","distance_default","a","b","mode","Color_default","l1","l2","sum_sq","i","d","valid_default","args","Color_default","scales_default","scale_default","chroma_default","colorbrewer","colorbrewerTypes","typeMap","key","colorbrewerProxy","target","prop","lower","colorbrewer_default","cmyk2rgb","args","unpack_default","c","m","y","k","alpha","cmyk2rgb_default","max","rgb2cmyk","args","g","b","unpack_default","k","m","y","rgb2cmyk_default","Color_default","rgb2cmyk_default","cmyk","args","chroma_default","input_default","cmyk2rgb_default","unpack_default","type_default","hsl2css","args","hsla","unpack_default","mode","last_default","rnd2","hsl2css_default","lab2css","args","laba","unpack_default","mode","last_default","rnd2","lab2css_default","lch2css","args","lcha","unpack_default","mode","last_default","rnd2","lch2css_default","oklab2css","args","laba","unpack_default","rnd2","rnd3","oklab2css_default","rgb2oklch","args","g","b","rest","unpack_default","l","a","b_","rgb2oklab_default","L","c","h","lab2lch_default","rgb2oklch_default","oklch2css","args","lcha","unpack_default","rnd2","rnd3","oklch2css_default","round","rgb2css","args","rgba","unpack_default","mode","last_default","hsl2css_default","rgb2hsl_default","prevWhitePoint","getLabWhitePoint","setLabWhitePoint","cssColor","lab2css_default","rgb2lab_default","lch2css_default","rgb2lch_default","oklab2css_default","rgb2oklab_default","oklch2css_default","rgb2oklch_default","rgb2css_default","oklch2rgb","args","unpack_default","l","c","h","rest","L","a","b_","lch2lab_default","r","g","b","oklab2rgb_default","oklch2rgb_default","INT_OR_PCT","FLOAT_OR_PCT","PCT","RE_S","SEP","COMMA","ANLGE","ALPHA","RE_RGB","RE_RGB_LEGACY","RE_RGBA_LEGACY","RE_HSL","RE_HSL_LEGACY","RE_HSLA_LEGACY","RE_LAB","RE_LCH","RE_OKLAB","RE_OKLCH","round","roundRGB","rgb","v","i","limit_default","percentToAbsolute","pct","min","max","signed","noneToValue","noneValue","css2rgb","css","m","input_default","alpha","hsl","hsl2rgb_default","lab","wp","getLabWhitePoint","setLabWhitePoint","lab2rgb_default","lch","lch2rgb_default","oklab","oklab2rgb_default","oklch","oklch2rgb_default","s","css2rgb_default","Color_default","mode","rgb2css_default","css","args","chroma_default","input_default","css2rgb_default","h","rest","type_default","input_default","args","rgb","unpack_default","gl","Color_default","chroma_default","Color_default","mode","rgb2hex_default","hex","args","chroma_default","input_default","hex2rgb_default","h","rest","type_default","log","temperature2rgb","kelvin","temp","r","g","b","temperature2rgb_default","round","rgb2temperature","args","rgb","unpack_default","r","b","minTemp","maxTemp","eps","temp","temperature2rgb_default","rgb2temperature_default","Color_default","rgb2temperature_default","temp","args","chroma_default","input_default","temperature2rgb_default","Color_default","rgb2oklch_default","oklch","args","chroma_default","input_default","oklch2rgb_default","unpack_default","type_default","chroma_default","analyze","average_default","bezier_default","blend_default","colorbrewer_default","Color_default","w3cx11_default","contrast_default","contrastAPCA_default","cubehelix_default","delta_e_default","distance_default","input_default","mix_default","limits","random_default","scale_default","scales_default","valid_default","chroma_js_default"],"mappings":";;AAAA,GAAM,CACJ,IAAAA,GACA,IAAAC,EACF,EAAI,KACGC,EAAQ,CAACC,EAAGC,EAAM,EAAGC,EAAO,IAC1BL,GAAIC,GAAIG,EAAKD,CAAC,EAAGE,CAAI,ECJ9B,IAAOC,GAAQC,GAAO,CACpBA,EAAI,SAAW,GACfA,EAAI,WAAaA,EAAI,MAAM,CAAC,EAC5B,QAASC,EAAI,EAAGA,GAAK,EAAGA,IAClBA,EAAI,IACFD,EAAIC,CAAC,EAAI,GAAKD,EAAIC,CAAC,EAAI,OAAKD,EAAI,SAAW,IAC/CA,EAAIC,CAAC,EAAIC,EAAMF,EAAIC,CAAC,EAAG,EAAG,GAAG,GACpBA,IAAM,IACfD,EAAIC,CAAC,EAAIC,EAAMF,EAAIC,CAAC,EAAG,EAAG,CAAC,GAG/B,OAAOD,CACT,ECZA,IAAMG,GAAc,CAAC,EACrB,QAASC,IAAQ,CAAC,UAAW,SAAU,SAAU,WAAY,QAAS,OAAQ,SAAU,YAAa,MAAM,EACzGD,GAAY,WAAWC,CAAI,GAAG,EAAIA,EAAK,YAAY,EAEtC,SAARC,EAAkBC,EAAK,CAC5B,OAAOH,GAAY,OAAO,UAAU,SAAS,KAAKG,CAAG,CAAC,GAAK,QAC7D,CCNA,IAAOC,EAAQ,CAACC,EAAMC,EAAW,OAE3BD,EAAK,QAAU,EAAU,MAAM,UAAU,MAAM,KAAKA,CAAI,EAGxDE,EAAKF,EAAK,CAAC,CAAC,GAAK,UAAYC,EACxBA,EAAS,MAAM,EAAE,E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