@phun-ky/moebius 1.0.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"moebius.js","sources":["../node_modules/chroma-js/chroma.js","../node_modules/nearest-color/nearestColor.js","../src/utils/color-objects/hsl.ts","../src/utils/color-objects/xyz.ts","../src/utils/color-objects/cmyk.ts","../src/utils/color-objects/rgb.ts","../src/utils/color-objects/hwb.ts","../src/utils/color-objects/lab.ts","../src/utils/color-objects/oklab.ts","../src/utils/color-objects/hsv.ts","../src/utils/color-objects/lch.ts","../src/utils/color-objects/oklch.ts","../src/utils/color-objects/hsi.ts","../src/utils/converters/to-float.ts","../src/utils/normalize-color-units.ts","../src/classes/MoebiusColor.ts","../src/utils/converters/to-hex.ts","../src/utils/converters/to-cmyk.ts","../src/utils/converters/to-xyz.ts","../src/utils/converters/to-hsl.ts","../src/utils/converters/to-hwb.ts","../src/utils/converters/to-lab.ts","../src/utils/converters/to-oklab.ts","../src/utils/converters/to-hsv.ts","../src/utils/converters/to-lch.ts","../src/utils/converters/to-oklch.ts","../src/utils/converters/to-hsi.ts","../src/utils/converters/to-rgb.ts","../src/utils/converters/to-object.ts","../src/constants/index.ts","../src/features/harmonize.ts","../src/utils/random.ts","../src/features/monochromatic.ts","../src/features/luminance-shift.ts","../src/utils/range.ts","../src/utils/get-chroma-bezier-scale-colors.ts","../src/utils/get-chroma-scale-colors.ts","../src/classes/MoebiusAccentColors.ts","../src/classes/MoebiusPaletteColors.ts","../src/classes/MoebiusThemeColors.ts","../src/classes/MoebiusPalettes.ts","../src/features/complement.ts","../src/features/darkmode.ts","../src/features/split.ts","../src/features/triadic.ts","../src/features/tetradic.ts","../src/features/pentadic.ts","../src/features/hexadic.ts","../src/features/analogous.ts","../src/features/interpolate.ts","../src/classes/MoebiusSVGHelper.ts","../src/utils/unique-id.ts","../src/utils/svg/get-start-mask-degree.ts","../src/utils/svg/pie-slice.ts","../src/main.ts"],"sourcesContent":["/**\n * chroma.js - JavaScript library for color conversions\n *\n * Copyright (c) 2011-2019, Gregor Aisch\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. The name Gregor Aisch may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * -------------------------------------------------------\n *\n * chroma.js includes colors from colorbrewer2.org, which are released under\n * the following license:\n *\n * Copyright (c) 2002 Cynthia Brewer, Mark Harrower,\n * and The 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,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n * either express or implied. See the License for the specific\n * language governing permissions and limitations under the License.\n *\n * ------------------------------------------------------\n *\n * Named colors are taken from X11 Color Names.\n * http://www.w3.org/TR/css3-color/#svg-color\n *\n * @preserve\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.chroma = factory());\n})(this, (function () { 'use strict';\n\n var limit$2 = function (x, min, max) {\n if ( min === void 0 ) min=0;\n if ( max === void 0 ) max=1;\n\n return x < min ? min : x > max ? max : x;\n };\n\n var limit$1 = limit$2;\n\n var clip_rgb$3 = function (rgb) {\n rgb._clipped = false;\n rgb._unclipped = rgb.slice(0);\n for (var i=0; i<=3; i++) {\n if (i < 3) {\n if (rgb[i] < 0 || rgb[i] > 255) { rgb._clipped = true; }\n rgb[i] = limit$1(rgb[i], 0, 255);\n } else if (i === 3) {\n rgb[i] = limit$1(rgb[i], 0, 1);\n }\n }\n return rgb;\n };\n\n // ported from jQuery's $.type\n var classToType = {};\n for (var i$1 = 0, list$1 = ['Boolean', 'Number', 'String', 'Function', 'Array', 'Date', 'RegExp', 'Undefined', 'Null']; i$1 < list$1.length; i$1 += 1) {\n var name = list$1[i$1];\n\n classToType[(\"[object \" + name + \"]\")] = name.toLowerCase();\n }\n var type$p = function(obj) {\n return classToType[Object.prototype.toString.call(obj)] || \"object\";\n };\n\n var type$o = type$p;\n\n var unpack$B = function (args, keyOrder) {\n if ( keyOrder === void 0 ) keyOrder=null;\n\n \t// 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 \tif (type$o(args[0]) == 'object' && keyOrder) {\n \t\treturn keyOrder.split('')\n \t\t\t.filter(function (k) { return args[0][k] !== undefined; })\n \t\t\t.map(function (k) { return args[0][k]; });\n \t}\n \t// otherwise we just return the first argument\n \t// (which we suppose is an array of args)\n return args[0];\n };\n\n var type$n = type$p;\n\n var last$4 = function (args) {\n if (args.length < 2) { return null; }\n var l = args.length-1;\n if (type$n(args[l]) == 'string') { return args[l].toLowerCase(); }\n return null;\n };\n\n var PI$2 = Math.PI;\n\n var utils = {\n \tclip_rgb: clip_rgb$3,\n \tlimit: limit$2,\n \ttype: type$p,\n \tunpack: unpack$B,\n \tlast: last$4,\n \tPI: PI$2,\n \tTWOPI: PI$2*2,\n \tPITHIRD: PI$2/3,\n \tDEG2RAD: PI$2 / 180,\n \tRAD2DEG: 180 / PI$2\n };\n\n var input$h = {\n \tformat: {},\n \tautodetect: []\n };\n\n var last$3 = utils.last;\n var clip_rgb$2 = utils.clip_rgb;\n var type$m = utils.type;\n var _input = input$h;\n\n var Color$D = function Color() {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var me = this;\n if (type$m(args[0]) === 'object' &&\n args[0].constructor &&\n args[0].constructor === this.constructor) {\n // the argument is already a Color instance\n return args[0];\n }\n\n // last argument could be the mode\n var mode = last$3(args);\n var autodetect = false;\n\n if (!mode) {\n autodetect = true;\n if (!_input.sorted) {\n _input.autodetect = _input.autodetect.sort(function (a,b) { return b.p - a.p; });\n _input.sorted = true;\n }\n // auto-detect format\n for (var i = 0, list = _input.autodetect; i < list.length; i += 1) {\n var chk = list[i];\n\n mode = chk.test.apply(chk, args);\n if (mode) { break; }\n }\n }\n\n if (_input.format[mode]) {\n var rgb = _input.format[mode].apply(null, autodetect ? args : args.slice(0,-1));\n me._rgb = clip_rgb$2(rgb);\n } else {\n throw new Error('unknown format: '+args);\n }\n\n // add alpha channel\n if (me._rgb.length === 3) { me._rgb.push(1); }\n };\n\n Color$D.prototype.toString = function toString () {\n if (type$m(this.hex) == 'function') { return this.hex(); }\n return (\"[\" + (this._rgb.join(',')) + \"]\");\n };\n\n var Color_1 = Color$D;\n\n var chroma$k = function () {\n \tvar args = [], len = arguments.length;\n \twhile ( len-- ) args[ len ] = arguments[ len ];\n\n \treturn new (Function.prototype.bind.apply( chroma$k.Color, [ null ].concat( args) ));\n };\n\n chroma$k.Color = Color_1;\n chroma$k.version = '2.4.2';\n\n var chroma_1 = chroma$k;\n\n var unpack$A = utils.unpack;\n var max$2 = Math.max;\n\n var rgb2cmyk$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$A(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n r = r / 255;\n g = g / 255;\n b = b / 255;\n var k = 1 - max$2(r,max$2(g,b));\n var f = k < 1 ? 1 / (1-k) : 0;\n var c = (1-r-k) * f;\n var m = (1-g-k) * f;\n var y = (1-b-k) * f;\n return [c,m,y,k];\n };\n\n var rgb2cmyk_1 = rgb2cmyk$1;\n\n var unpack$z = utils.unpack;\n\n var cmyk2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$z(args, 'cmyk');\n var c = args[0];\n var m = args[1];\n var y = args[2];\n var k = args[3];\n var alpha = args.length > 4 ? args[4] : 1;\n if (k === 1) { return [0,0,0,alpha]; }\n return [\n c >= 1 ? 0 : 255 * (1-c) * (1-k), // r\n m >= 1 ? 0 : 255 * (1-m) * (1-k), // g\n y >= 1 ? 0 : 255 * (1-y) * (1-k), // b\n alpha\n ];\n };\n\n var cmyk2rgb_1 = cmyk2rgb;\n\n var chroma$j = chroma_1;\n var Color$C = Color_1;\n var input$g = input$h;\n var unpack$y = utils.unpack;\n var type$l = utils.type;\n\n var rgb2cmyk = rgb2cmyk_1;\n\n Color$C.prototype.cmyk = function() {\n return rgb2cmyk(this._rgb);\n };\n\n chroma$j.cmyk = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$C, [ null ].concat( args, ['cmyk']) ));\n };\n\n input$g.format.cmyk = cmyk2rgb_1;\n\n input$g.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$y(args, 'cmyk');\n if (type$l(args) === 'array' && args.length === 4) {\n return 'cmyk';\n }\n }\n });\n\n var unpack$x = utils.unpack;\n var last$2 = utils.last;\n var rnd = function (a) { return Math.round(a*100)/100; };\n\n /*\n * supported arguments:\n * - hsl2css(h,s,l)\n * - hsl2css(h,s,l,a)\n * - hsl2css([h,s,l], mode)\n * - hsl2css([h,s,l,a], mode)\n * - hsl2css({h,s,l,a}, mode)\n */\n var hsl2css$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var hsla = unpack$x(args, 'hsla');\n var mode = last$2(args) || 'lsa';\n hsla[0] = rnd(hsla[0] || 0);\n hsla[1] = rnd(hsla[1]*100) + '%';\n hsla[2] = rnd(hsla[2]*100) + '%';\n if (mode === 'hsla' || (hsla.length > 3 && hsla[3]<1)) {\n hsla[3] = hsla.length > 3 ? hsla[3] : 1;\n mode = 'hsla';\n } else {\n hsla.length = 3;\n }\n return (mode + \"(\" + (hsla.join(',')) + \")\");\n };\n\n var hsl2css_1 = hsl2css$1;\n\n var unpack$w = utils.unpack;\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 */\n var rgb2hsl$3 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$w(args, 'rgba');\n var r = args[0];\n var g = args[1];\n var b = args[2];\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n\n var l = (max + min) / 2;\n var s, h;\n\n if (max === min){\n s = 0;\n h = Number.NaN;\n } else {\n s = l < 0.5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);\n }\n\n if (r == max) { h = (g - b) / (max - min); }\n else if (g == max) { h = 2 + (b - r) / (max - min); }\n else if (b == max) { h = 4 + (r - g) / (max - min); }\n\n h *= 60;\n if (h < 0) { h += 360; }\n if (args.length>3 && args[3]!==undefined) { return [h,s,l,args[3]]; }\n return [h,s,l];\n };\n\n var rgb2hsl_1 = rgb2hsl$3;\n\n var unpack$v = utils.unpack;\n var last$1 = utils.last;\n var hsl2css = hsl2css_1;\n var rgb2hsl$2 = rgb2hsl_1;\n var round$6 = Math.round;\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 */\n var rgb2css$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgba = unpack$v(args, 'rgba');\n var mode = last$1(args) || 'rgb';\n if (mode.substr(0,3) == 'hsl') {\n return hsl2css(rgb2hsl$2(rgba), mode);\n }\n rgba[0] = round$6(rgba[0]);\n rgba[1] = round$6(rgba[1]);\n rgba[2] = round$6(rgba[2]);\n if (mode === 'rgba' || (rgba.length > 3 && rgba[3]<1)) {\n rgba[3] = rgba.length > 3 ? rgba[3] : 1;\n mode = 'rgba';\n }\n return (mode + \"(\" + (rgba.slice(0,mode==='rgb'?3:4).join(',')) + \")\");\n };\n\n var rgb2css_1 = rgb2css$1;\n\n var unpack$u = utils.unpack;\n var round$5 = Math.round;\n\n var hsl2rgb$1 = function () {\n var assign;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$u(args, 'hsl');\n var h = args[0];\n var s = args[1];\n var l = args[2];\n var r,g,b;\n if (s === 0) {\n r = g = b = l*255;\n } else {\n var t3 = [0,0,0];\n var c = [0,0,0];\n var t2 = l < 0.5 ? l * (1+s) : l+s-l*s;\n var t1 = 2 * l - t2;\n var h_ = h / 360;\n t3[0] = h_ + 1/3;\n t3[1] = h_;\n t3[2] = h_ - 1/3;\n for (var 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)\n { c[i] = t1 + (t2 - t1) * 6 * t3[i]; }\n else if (2 * t3[i] < 1)\n { c[i] = t2; }\n else if (3 * t3[i] < 2)\n { c[i] = t1 + (t2 - t1) * ((2 / 3) - t3[i]) * 6; }\n else\n { c[i] = t1; }\n }\n (assign = [round$5(c[0]*255),round$5(c[1]*255),round$5(c[2]*255)], r = assign[0], g = assign[1], b = assign[2]);\n }\n if (args.length > 3) {\n // keep alpha channel\n return [r,g,b,args[3]];\n }\n return [r,g,b,1];\n };\n\n var hsl2rgb_1 = hsl2rgb$1;\n\n var hsl2rgb = hsl2rgb_1;\n var input$f = input$h;\n\n var RE_RGB = /^rgb\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*\\)$/;\n var RE_RGBA = /^rgba\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n var RE_RGB_PCT = /^rgb\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\n var RE_RGBA_PCT = /^rgba\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n var RE_HSL = /^hsl\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\n var RE_HSLA = /^hsla\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n\n var round$4 = Math.round;\n\n var css2rgb$1 = function (css) {\n css = css.toLowerCase().trim();\n var m;\n\n if (input$f.format.named) {\n try {\n return input$f.format.named(css);\n } catch (e) {\n // eslint-disable-next-line\n }\n }\n\n // rgb(250,20,0)\n if ((m = css.match(RE_RGB))) {\n var rgb = m.slice(1,4);\n for (var i=0; i<3; i++) {\n rgb[i] = +rgb[i];\n }\n rgb[3] = 1; // default alpha\n return rgb;\n }\n\n // rgba(250,20,0,0.4)\n if ((m = css.match(RE_RGBA))) {\n var rgb$1 = m.slice(1,5);\n for (var i$1=0; i$1<4; i$1++) {\n rgb$1[i$1] = +rgb$1[i$1];\n }\n return rgb$1;\n }\n\n // rgb(100%,0%,0%)\n if ((m = css.match(RE_RGB_PCT))) {\n var rgb$2 = m.slice(1,4);\n for (var i$2=0; i$2<3; i$2++) {\n rgb$2[i$2] = round$4(rgb$2[i$2] * 2.55);\n }\n rgb$2[3] = 1; // default alpha\n return rgb$2;\n }\n\n // rgba(100%,0%,0%,0.4)\n if ((m = css.match(RE_RGBA_PCT))) {\n var rgb$3 = m.slice(1,5);\n for (var i$3=0; i$3<3; i$3++) {\n rgb$3[i$3] = round$4(rgb$3[i$3] * 2.55);\n }\n rgb$3[3] = +rgb$3[3];\n return rgb$3;\n }\n\n // hsl(0,100%,50%)\n if ((m = css.match(RE_HSL))) {\n var hsl = m.slice(1,4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n var rgb$4 = hsl2rgb(hsl);\n rgb$4[3] = 1;\n return rgb$4;\n }\n\n // hsla(0,100%,50%,0.5)\n if ((m = css.match(RE_HSLA))) {\n var hsl$1 = m.slice(1,4);\n hsl$1[1] *= 0.01;\n hsl$1[2] *= 0.01;\n var rgb$5 = hsl2rgb(hsl$1);\n rgb$5[3] = +m[4]; // default alpha = 1\n return rgb$5;\n }\n };\n\n css2rgb$1.test = function (s) {\n return RE_RGB.test(s) ||\n RE_RGBA.test(s) ||\n RE_RGB_PCT.test(s) ||\n RE_RGBA_PCT.test(s) ||\n RE_HSL.test(s) ||\n RE_HSLA.test(s);\n };\n\n var css2rgb_1 = css2rgb$1;\n\n var chroma$i = chroma_1;\n var Color$B = Color_1;\n var input$e = input$h;\n var type$k = utils.type;\n\n var rgb2css = rgb2css_1;\n var css2rgb = css2rgb_1;\n\n Color$B.prototype.css = function(mode) {\n return rgb2css(this._rgb, mode);\n };\n\n chroma$i.css = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$B, [ null ].concat( args, ['css']) ));\n };\n\n input$e.format.css = css2rgb;\n\n input$e.autodetect.push({\n p: 5,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$k(h) === 'string' && css2rgb.test(h)) {\n return 'css';\n }\n }\n });\n\n var Color$A = Color_1;\n var chroma$h = chroma_1;\n var input$d = input$h;\n var unpack$t = utils.unpack;\n\n input$d.format.gl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgb = unpack$t(args, 'rgba');\n rgb[0] *= 255;\n rgb[1] *= 255;\n rgb[2] *= 255;\n return rgb;\n };\n\n chroma$h.gl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$A, [ null ].concat( args, ['gl']) ));\n };\n\n Color$A.prototype.gl = function() {\n var rgb = this._rgb;\n return [rgb[0]/255, rgb[1]/255, rgb[2]/255, rgb[3]];\n };\n\n var unpack$s = utils.unpack;\n\n var rgb2hcg$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$s(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var min = Math.min(r, g, b);\n var max = Math.max(r, g, b);\n var delta = max - min;\n var c = delta * 100 / 255;\n var _g = min / (255 - delta) * 100;\n var h;\n if (delta === 0) {\n h = Number.NaN;\n } else {\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, c, _g];\n };\n\n var rgb2hcg_1 = rgb2hcg$1;\n\n var unpack$r = utils.unpack;\n var floor$3 = Math.floor;\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\n var hcg2rgb = function () {\n var assign, assign$1, assign$2, assign$3, assign$4, assign$5;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$r(args, 'hcg');\n var h = args[0];\n var c = args[1];\n var _g = args[2];\n var r,g,b;\n _g = _g * 255;\n var _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 var i = floor$3(h);\n var f = h - i;\n var p = _g * (1 - c);\n var q = p + _c * (1 - f);\n var t = p + _c * f;\n var v = p + _c;\n switch (i) {\n case 0: (assign = [v, t, p], r = assign[0], g = assign[1], b = assign[2]); break\n case 1: (assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2]); break\n case 2: (assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2]); break\n case 3: (assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2]); break\n case 4: (assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2]); break\n case 5: (assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2]); break\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var hcg2rgb_1 = hcg2rgb;\n\n var unpack$q = utils.unpack;\n var type$j = utils.type;\n var chroma$g = chroma_1;\n var Color$z = Color_1;\n var input$c = input$h;\n\n var rgb2hcg = rgb2hcg_1;\n\n Color$z.prototype.hcg = function() {\n return rgb2hcg(this._rgb);\n };\n\n chroma$g.hcg = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$z, [ null ].concat( args, ['hcg']) ));\n };\n\n input$c.format.hcg = hcg2rgb_1;\n\n input$c.autodetect.push({\n p: 1,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$q(args, 'hcg');\n if (type$j(args) === 'array' && args.length === 3) {\n return 'hcg';\n }\n }\n });\n\n var unpack$p = utils.unpack;\n var last = utils.last;\n var round$3 = Math.round;\n\n var rgb2hex$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$p(args, 'rgba');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var a = ref[3];\n var mode = last(args) || 'auto';\n if (a === undefined) { a = 1; }\n if (mode === 'auto') {\n mode = a < 1 ? 'rgba' : 'rgb';\n }\n r = round$3(r);\n g = round$3(g);\n b = round$3(b);\n var u = r << 16 | g << 8 | b;\n var str = \"000000\" + u.toString(16); //#.toUpperCase();\n str = str.substr(str.length - 6);\n var hxa = '0' + round$3(a * 255).toString(16);\n hxa = hxa.substr(hxa.length - 2);\n switch (mode.toLowerCase()) {\n case 'rgba': return (\"#\" + str + hxa);\n case 'argb': return (\"#\" + hxa + str);\n default: return (\"#\" + str);\n }\n };\n\n var rgb2hex_1 = rgb2hex$2;\n\n var RE_HEX = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;\n var RE_HEXA = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;\n\n var hex2rgb$1 = function (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 var u = parseInt(hex, 16);\n var r = u >> 16;\n var g = u >> 8 & 0xFF;\n var 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 var u$1 = parseInt(hex, 16);\n var r$1 = u$1 >> 24 & 0xFF;\n var g$1 = u$1 >> 16 & 0xFF;\n var b$1 = u$1 >> 8 & 0xFF;\n var a = Math.round((u$1 & 0xFF) / 0xFF * 100) / 100;\n return [r$1,g$1,b$1,a];\n }\n\n // we used to check for css colors here\n // if _input.css? and rgb = _input.css hex\n // return rgb\n\n throw new Error((\"unknown hex color: \" + hex));\n };\n\n var hex2rgb_1 = hex2rgb$1;\n\n var chroma$f = chroma_1;\n var Color$y = Color_1;\n var type$i = utils.type;\n var input$b = input$h;\n\n var rgb2hex$1 = rgb2hex_1;\n\n Color$y.prototype.hex = function(mode) {\n return rgb2hex$1(this._rgb, mode);\n };\n\n chroma$f.hex = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$y, [ null ].concat( args, ['hex']) ));\n };\n\n input$b.format.hex = hex2rgb_1;\n input$b.autodetect.push({\n p: 4,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$i(h) === 'string' && [3,4,5,6,7,8,9].indexOf(h.length) >= 0) {\n return 'hex';\n }\n }\n });\n\n var unpack$o = utils.unpack;\n var TWOPI$2 = utils.TWOPI;\n var min$2 = Math.min;\n var sqrt$4 = Math.sqrt;\n var acos = Math.acos;\n\n var rgb2hsi$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp\n */\n var ref = unpack$o(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n r /= 255;\n g /= 255;\n b /= 255;\n var h;\n var min_ = min$2(r,g,b);\n var i = (r+g+b) / 3;\n var 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$4((r-g)*(r-g) + (r-b)*(g-b));\n h = acos(h);\n if (b > g) {\n h = TWOPI$2 - h;\n }\n h /= TWOPI$2;\n }\n return [h*360,s,i];\n };\n\n var rgb2hsi_1 = rgb2hsi$1;\n\n var unpack$n = utils.unpack;\n var limit = utils.limit;\n var TWOPI$1 = utils.TWOPI;\n var PITHIRD = utils.PITHIRD;\n var cos$4 = Math.cos;\n\n /*\n * hue [0..360]\n * saturation [0..1]\n * intensity [0..1]\n */\n var hsi2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp\n */\n args = unpack$n(args, 'hsi');\n var h = args[0];\n var s = args[1];\n var i = args[2];\n var r,g,b;\n\n if (isNaN(h)) { h = 0; }\n if (isNaN(s)) { s = 0; }\n // normalize hue\n if (h > 360) { h -= 360; }\n if (h < 0) { h += 360; }\n h /= 360;\n if (h < 1/3) {\n b = (1-s)/3;\n r = (1+s*cos$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*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$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*h))/3;\n b = 1 - (r+g);\n } else {\n h -= 2/3;\n g = (1-s)/3;\n b = (1+s*cos$4(TWOPI$1*h)/cos$4(PITHIRD-TWOPI$1*h))/3;\n r = 1 - (g+b);\n }\n r = limit(i*r*3);\n g = limit(i*g*3);\n b = limit(i*b*3);\n return [r*255, g*255, b*255, args.length > 3 ? args[3] : 1];\n };\n\n var hsi2rgb_1 = hsi2rgb;\n\n var unpack$m = utils.unpack;\n var type$h = utils.type;\n var chroma$e = chroma_1;\n var Color$x = Color_1;\n var input$a = input$h;\n\n var rgb2hsi = rgb2hsi_1;\n\n Color$x.prototype.hsi = function() {\n return rgb2hsi(this._rgb);\n };\n\n chroma$e.hsi = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$x, [ null ].concat( args, ['hsi']) ));\n };\n\n input$a.format.hsi = hsi2rgb_1;\n\n input$a.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$m(args, 'hsi');\n if (type$h(args) === 'array' && args.length === 3) {\n return 'hsi';\n }\n }\n });\n\n var unpack$l = utils.unpack;\n var type$g = utils.type;\n var chroma$d = chroma_1;\n var Color$w = Color_1;\n var input$9 = input$h;\n\n var rgb2hsl$1 = rgb2hsl_1;\n\n Color$w.prototype.hsl = function() {\n return rgb2hsl$1(this._rgb);\n };\n\n chroma$d.hsl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$w, [ null ].concat( args, ['hsl']) ));\n };\n\n input$9.format.hsl = hsl2rgb_1;\n\n input$9.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$l(args, 'hsl');\n if (type$g(args) === 'array' && args.length === 3) {\n return 'hsl';\n }\n }\n });\n\n var unpack$k = utils.unpack;\n var min$1 = Math.min;\n var max$1 = Math.max;\n\n /*\n * supported arguments:\n * - rgb2hsv(r,g,b)\n * - rgb2hsv([r,g,b])\n * - rgb2hsv({r,g,b})\n */\n var rgb2hsl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$k(args, 'rgb');\n var r = args[0];\n var g = args[1];\n var b = args[2];\n var min_ = min$1(r, g, b);\n var max_ = max$1(r, g, b);\n var delta = max_ - min_;\n var h,s,v;\n v = max_ / 255.0;\n if (max_ === 0) {\n h = Number.NaN;\n s = 0;\n } else {\n s = delta / max_;\n if (r === max_) { h = (g - b) / delta; }\n if (g === max_) { h = 2+(b - r) / delta; }\n if (b === max_) { h = 4+(r - g) / delta; }\n h *= 60;\n if (h < 0) { h += 360; }\n }\n return [h, s, v]\n };\n\n var rgb2hsv$1 = rgb2hsl;\n\n var unpack$j = utils.unpack;\n var floor$2 = Math.floor;\n\n var hsv2rgb = function () {\n var assign, assign$1, assign$2, assign$3, assign$4, assign$5;\n\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n args = unpack$j(args, 'hsv');\n var h = args[0];\n var s = args[1];\n var v = args[2];\n var r,g,b;\n v *= 255;\n if (s === 0) {\n r = g = b = v;\n } else {\n if (h === 360) { h = 0; }\n if (h > 360) { h -= 360; }\n if (h < 0) { h += 360; }\n h /= 60;\n\n var i = floor$2(h);\n var f = h - i;\n var p = v * (1 - s);\n var q = v * (1 - s * f);\n var t = v * (1 - s * (1 - f));\n\n switch (i) {\n case 0: (assign = [v, t, p], r = assign[0], g = assign[1], b = assign[2]); break\n case 1: (assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2]); break\n case 2: (assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2]); break\n case 3: (assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2]); break\n case 4: (assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2]); break\n case 5: (assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2]); break\n }\n }\n return [r,g,b,args.length > 3?args[3]:1];\n };\n\n var hsv2rgb_1 = hsv2rgb;\n\n var unpack$i = utils.unpack;\n var type$f = utils.type;\n var chroma$c = chroma_1;\n var Color$v = Color_1;\n var input$8 = input$h;\n\n var rgb2hsv = rgb2hsv$1;\n\n Color$v.prototype.hsv = function() {\n return rgb2hsv(this._rgb);\n };\n\n chroma$c.hsv = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$v, [ null ].concat( args, ['hsv']) ));\n };\n\n input$8.format.hsv = hsv2rgb_1;\n\n input$8.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$i(args, 'hsv');\n if (type$f(args) === 'array' && args.length === 3) {\n return 'hsv';\n }\n }\n });\n\n var labConstants = {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n\n // D65 standard referent\n Xn: 0.950470,\n Yn: 1,\n Zn: 1.088830,\n\n t0: 0.137931034, // 4 / 29\n t1: 0.206896552, // 6 / 29\n t2: 0.12841855, // 3 * t1 * t1\n t3: 0.008856452, // t1 * t1 * t1\n };\n\n var LAB_CONSTANTS$3 = labConstants;\n var unpack$h = utils.unpack;\n var pow$a = Math.pow;\n\n var rgb2lab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$h(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2xyz(r,g,b);\n var x = ref$1[0];\n var y = ref$1[1];\n var z = ref$1[2];\n var l = 116 * y - 16;\n return [l < 0 ? 0 : l, 500 * (x - y), 200 * (y - z)];\n };\n\n var rgb_xyz = function (r) {\n if ((r /= 255) <= 0.04045) { return r / 12.92; }\n return pow$a((r + 0.055) / 1.055, 2.4);\n };\n\n var xyz_lab = function (t) {\n if (t > LAB_CONSTANTS$3.t3) { return pow$a(t, 1 / 3); }\n return t / LAB_CONSTANTS$3.t2 + LAB_CONSTANTS$3.t0;\n };\n\n var rgb2xyz = function (r,g,b) {\n r = rgb_xyz(r);\n g = rgb_xyz(g);\n b = rgb_xyz(b);\n var x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS$3.Xn);\n var y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / LAB_CONSTANTS$3.Yn);\n var z = xyz_lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / LAB_CONSTANTS$3.Zn);\n return [x,y,z];\n };\n\n var rgb2lab_1 = rgb2lab$2;\n\n var LAB_CONSTANTS$2 = labConstants;\n var unpack$g = utils.unpack;\n var pow$9 = Math.pow;\n\n /*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\n var lab2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$g(args, 'lab');\n var l = args[0];\n var a = args[1];\n var b = args[2];\n var x,y,z, r,g,b_;\n\n y = (l + 16) / 116;\n x = isNaN(a) ? y : y + a / 500;\n z = isNaN(b) ? y : y - b / 200;\n\n y = LAB_CONSTANTS$2.Yn * lab_xyz(y);\n x = LAB_CONSTANTS$2.Xn * lab_xyz(x);\n z = LAB_CONSTANTS$2.Zn * lab_xyz(z);\n\n r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z); // D65 -> sRGB\n g = xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z);\n b_ = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);\n\n return [r,g,b_,args.length > 3 ? args[3] : 1];\n };\n\n var xyz_rgb = function (r) {\n return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow$9(r, 1 / 2.4) - 0.055)\n };\n\n var lab_xyz = function (t) {\n return t > LAB_CONSTANTS$2.t1 ? t * t * t : LAB_CONSTANTS$2.t2 * (t - LAB_CONSTANTS$2.t0)\n };\n\n var lab2rgb_1 = lab2rgb$1;\n\n var unpack$f = utils.unpack;\n var type$e = utils.type;\n var chroma$b = chroma_1;\n var Color$u = Color_1;\n var input$7 = input$h;\n\n var rgb2lab$1 = rgb2lab_1;\n\n Color$u.prototype.lab = function() {\n return rgb2lab$1(this._rgb);\n };\n\n chroma$b.lab = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$u, [ null ].concat( args, ['lab']) ));\n };\n\n input$7.format.lab = lab2rgb_1;\n\n input$7.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$f(args, 'lab');\n if (type$e(args) === 'array' && args.length === 3) {\n return 'lab';\n }\n }\n });\n\n var unpack$e = utils.unpack;\n var RAD2DEG = utils.RAD2DEG;\n var sqrt$3 = Math.sqrt;\n var atan2$2 = Math.atan2;\n var round$2 = Math.round;\n\n var lab2lch$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$e(args, 'lab');\n var l = ref[0];\n var a = ref[1];\n var b = ref[2];\n var c = sqrt$3(a * a + b * b);\n var h = (atan2$2(b, a) * RAD2DEG + 360) % 360;\n if (round$2(c*10000) === 0) { h = Number.NaN; }\n return [l, c, h];\n };\n\n var lab2lch_1 = lab2lch$2;\n\n var unpack$d = utils.unpack;\n var rgb2lab = rgb2lab_1;\n var lab2lch$1 = lab2lch_1;\n\n var rgb2lch$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$d(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2lab(r,g,b);\n var l = ref$1[0];\n var a = ref$1[1];\n var b_ = ref$1[2];\n return lab2lch$1(l,a,b_);\n };\n\n var rgb2lch_1 = rgb2lch$1;\n\n var unpack$c = utils.unpack;\n var DEG2RAD = utils.DEG2RAD;\n var sin$3 = Math.sin;\n var cos$3 = Math.cos;\n\n var lch2lab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n\n A saturation multiplier was added by Gregor Aisch\n */\n var ref = unpack$c(args, 'lch');\n var l = ref[0];\n var c = ref[1];\n var h = ref[2];\n if (isNaN(h)) { h = 0; }\n h = h * DEG2RAD;\n return [l, cos$3(h) * c, sin$3(h) * c]\n };\n\n var lch2lab_1 = lch2lab$2;\n\n var unpack$b = utils.unpack;\n var lch2lab$1 = lch2lab_1;\n var lab2rgb = lab2rgb_1;\n\n var lch2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$b(args, 'lch');\n var l = args[0];\n var c = args[1];\n var h = args[2];\n var ref = lch2lab$1 (l,c,h);\n var L = ref[0];\n var a = ref[1];\n var b_ = ref[2];\n var ref$1 = lab2rgb (L,a,b_);\n var r = ref$1[0];\n var g = ref$1[1];\n var b = ref$1[2];\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var lch2rgb_1 = lch2rgb$1;\n\n var unpack$a = utils.unpack;\n var lch2rgb = lch2rgb_1;\n\n var hcl2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var hcl = unpack$a(args, 'hcl').reverse();\n return lch2rgb.apply(void 0, hcl);\n };\n\n var hcl2rgb_1 = hcl2rgb;\n\n var unpack$9 = utils.unpack;\n var type$d = utils.type;\n var chroma$a = chroma_1;\n var Color$t = Color_1;\n var input$6 = input$h;\n\n var rgb2lch = rgb2lch_1;\n\n Color$t.prototype.lch = function() { return rgb2lch(this._rgb); };\n Color$t.prototype.hcl = function() { return rgb2lch(this._rgb).reverse(); };\n\n chroma$a.lch = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$t, [ null ].concat( args, ['lch']) ));\n };\n chroma$a.hcl = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$t, [ null ].concat( args, ['hcl']) ));\n };\n\n input$6.format.lch = lch2rgb_1;\n input$6.format.hcl = hcl2rgb_1;\n\n ['lch','hcl'].forEach(function (m) { return input$6.autodetect.push({\n p: 2,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$9(args, m);\n if (type$d(args) === 'array' && args.length === 3) {\n return m;\n }\n }\n }); });\n\n /**\n \tX11 color names\n\n \thttp://www.w3.org/TR/css3-color/#svg-color\n */\n\n var w3cx11$1 = {\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 cornflower: '#6495ed',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n laserlemon: '#ffff54',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrod: '#fafad2',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n maroon2: '#7f0000',\n maroon3: '#b03060',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n purple2: '#7f007f',\n purple3: '#a020f0',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32'\n };\n\n var w3cx11_1 = w3cx11$1;\n\n var Color$s = Color_1;\n var input$5 = input$h;\n var type$c = utils.type;\n\n var w3cx11 = w3cx11_1;\n var hex2rgb = hex2rgb_1;\n var rgb2hex = rgb2hex_1;\n\n Color$s.prototype.name = function() {\n var hex = rgb2hex(this._rgb, 'rgb');\n for (var i = 0, list = Object.keys(w3cx11); i < list.length; i += 1) {\n var n = list[i];\n\n if (w3cx11[n] === hex) { return n.toLowerCase(); }\n }\n return hex;\n };\n\n input$5.format.named = function (name) {\n name = name.toLowerCase();\n if (w3cx11[name]) { return hex2rgb(w3cx11[name]); }\n throw new Error('unknown color name: '+name);\n };\n\n input$5.autodetect.push({\n p: 5,\n test: function (h) {\n var rest = [], len = arguments.length - 1;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 1 ];\n\n if (!rest.length && type$c(h) === 'string' && w3cx11[h.toLowerCase()]) {\n return 'named';\n }\n }\n });\n\n var unpack$8 = utils.unpack;\n\n var rgb2num$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$8(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n return (r << 16) + (g << 8) + b;\n };\n\n var rgb2num_1 = rgb2num$1;\n\n var type$b = utils.type;\n\n var num2rgb = function (num) {\n if (type$b(num) == \"number\" && num >= 0 && num <= 0xFFFFFF) {\n var r = num >> 16;\n var g = (num >> 8) & 0xFF;\n var b = num & 0xFF;\n return [r,g,b,1];\n }\n throw new Error(\"unknown num color: \"+num);\n };\n\n var num2rgb_1 = num2rgb;\n\n var chroma$9 = chroma_1;\n var Color$r = Color_1;\n var input$4 = input$h;\n var type$a = utils.type;\n\n var rgb2num = rgb2num_1;\n\n Color$r.prototype.num = function() {\n return rgb2num(this._rgb);\n };\n\n chroma$9.num = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$r, [ null ].concat( args, ['num']) ));\n };\n\n input$4.format.num = num2rgb_1;\n\n input$4.autodetect.push({\n p: 5,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n if (args.length === 1 && type$a(args[0]) === 'number' && args[0] >= 0 && args[0] <= 0xFFFFFF) {\n return 'num';\n }\n }\n });\n\n var chroma$8 = chroma_1;\n var Color$q = Color_1;\n var input$3 = input$h;\n var unpack$7 = utils.unpack;\n var type$9 = utils.type;\n var round$1 = Math.round;\n\n Color$q.prototype.rgb = function(rnd) {\n if ( rnd === void 0 ) rnd=true;\n\n if (rnd === false) { return this._rgb.slice(0,3); }\n return this._rgb.slice(0,3).map(round$1);\n };\n\n Color$q.prototype.rgba = function(rnd) {\n if ( rnd === void 0 ) rnd=true;\n\n return this._rgb.slice(0,4).map(function (v,i) {\n return i<3 ? (rnd === false ? v : round$1(v)) : v;\n });\n };\n\n chroma$8.rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$q, [ null ].concat( args, ['rgb']) ));\n };\n\n input$3.format.rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgba = unpack$7(args, 'rgba');\n if (rgba[3] === undefined) { rgba[3] = 1; }\n return rgba;\n };\n\n input$3.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$7(args, 'rgba');\n if (type$9(args) === 'array' && (args.length === 3 ||\n args.length === 4 && type$9(args[3]) == 'number' && args[3] >= 0 && args[3] <= 1)) {\n return 'rgb';\n }\n }\n });\n\n /*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n */\n\n var log$1 = Math.log;\n\n var temperature2rgb$1 = function (kelvin) {\n var temp = kelvin / 100;\n var 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$1(g);\n b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp-10) + 115.67994401066147 * log$1(b);\n } else {\n r = 351.97690566805693 + 0.114206453784165 * (r = temp-55) - 40.25366309332127 * log$1(r);\n g = 325.4494125711974 + 0.07943456536662342 * (g = temp-50) - 28.0852963507957 * log$1(g);\n b = 255;\n }\n return [r,g,b,1];\n };\n\n var temperature2rgb_1 = temperature2rgb$1;\n\n /*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n **/\n\n var temperature2rgb = temperature2rgb_1;\n var unpack$6 = utils.unpack;\n var round = Math.round;\n\n var rgb2temperature$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var rgb = unpack$6(args, 'rgb');\n var r = rgb[0], b = rgb[2];\n var minTemp = 1000;\n var maxTemp = 40000;\n var eps = 0.4;\n var temp;\n while (maxTemp - minTemp > eps) {\n temp = (maxTemp + minTemp) * 0.5;\n var rgb$1 = temperature2rgb(temp);\n if ((rgb$1[2] / rgb$1[0]) >= (b / r)) {\n maxTemp = temp;\n } else {\n minTemp = temp;\n }\n }\n return round(temp);\n };\n\n var rgb2temperature_1 = rgb2temperature$1;\n\n var chroma$7 = chroma_1;\n var Color$p = Color_1;\n var input$2 = input$h;\n\n var rgb2temperature = rgb2temperature_1;\n\n Color$p.prototype.temp =\n Color$p.prototype.kelvin =\n Color$p.prototype.temperature = function() {\n return rgb2temperature(this._rgb);\n };\n\n chroma$7.temp =\n chroma$7.kelvin =\n chroma$7.temperature = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$p, [ null ].concat( args, ['temp']) ));\n };\n\n input$2.format.temp =\n input$2.format.kelvin =\n input$2.format.temperature = temperature2rgb_1;\n\n var unpack$5 = utils.unpack;\n var cbrt = Math.cbrt;\n var pow$8 = Math.pow;\n var sign$1 = Math.sign;\n\n var rgb2oklab$2 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // OKLab color space implementation taken from\n // https://bottosson.github.io/posts/oklab/\n var ref = unpack$5(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = [rgb2lrgb(r / 255), rgb2lrgb(g / 255), rgb2lrgb(b / 255)];\n var lr = ref$1[0];\n var lg = ref$1[1];\n var lb = ref$1[2];\n var l = cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);\n var m = cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);\n var s = cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);\n\n return [\n 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s\n ];\n };\n\n var rgb2oklab_1 = rgb2oklab$2;\n\n function rgb2lrgb(c) {\n var abs = Math.abs(c);\n if (abs < 0.04045) {\n return c / 12.92;\n }\n return (sign$1(c) || 1) * pow$8((abs + 0.055) / 1.055, 2.4);\n }\n\n var unpack$4 = utils.unpack;\n var pow$7 = Math.pow;\n var sign = Math.sign;\n\n /*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\n var oklab2rgb$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$4(args, 'lab');\n var L = args[0];\n var a = args[1];\n var b = args[2];\n\n var l = pow$7(L + 0.3963377774 * a + 0.2158037573 * b, 3);\n var m = pow$7(L - 0.1055613458 * a - 0.0638541728 * b, 3);\n var s = pow$7(L - 0.0894841775 * a - 1.291485548 * b, 3);\n\n return [\n 255 * lrgb2rgb(+4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n 255 * lrgb2rgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n 255 * lrgb2rgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),\n args.length > 3 ? args[3] : 1\n ];\n };\n\n var oklab2rgb_1 = oklab2rgb$1;\n\n function lrgb2rgb(c) {\n var abs = Math.abs(c);\n if (abs > 0.0031308) {\n return (sign(c) || 1) * (1.055 * pow$7(abs, 1 / 2.4) - 0.055);\n }\n return c * 12.92;\n }\n\n var unpack$3 = utils.unpack;\n var type$8 = utils.type;\n var chroma$6 = chroma_1;\n var Color$o = Color_1;\n var input$1 = input$h;\n\n var rgb2oklab$1 = rgb2oklab_1;\n\n Color$o.prototype.oklab = function () {\n return rgb2oklab$1(this._rgb);\n };\n\n chroma$6.oklab = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$o, [ null ].concat( args, ['oklab']) ));\n };\n\n input$1.format.oklab = oklab2rgb_1;\n\n input$1.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$3(args, 'oklab');\n if (type$8(args) === 'array' && args.length === 3) {\n return 'oklab';\n }\n }\n });\n\n var unpack$2 = utils.unpack;\n var rgb2oklab = rgb2oklab_1;\n var lab2lch = lab2lch_1;\n\n var rgb2oklch$1 = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var ref = unpack$2(args, 'rgb');\n var r = ref[0];\n var g = ref[1];\n var b = ref[2];\n var ref$1 = rgb2oklab(r, g, b);\n var l = ref$1[0];\n var a = ref$1[1];\n var b_ = ref$1[2];\n return lab2lch(l, a, b_);\n };\n\n var rgb2oklch_1 = rgb2oklch$1;\n\n var unpack$1 = utils.unpack;\n var lch2lab = lch2lab_1;\n var oklab2rgb = oklab2rgb_1;\n\n var oklch2rgb = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack$1(args, 'lch');\n var l = args[0];\n var c = args[1];\n var h = args[2];\n var ref = lch2lab(l, c, h);\n var L = ref[0];\n var a = ref[1];\n var b_ = ref[2];\n var ref$1 = oklab2rgb(L, a, b_);\n var r = ref$1[0];\n var g = ref$1[1];\n var b = ref$1[2];\n return [r, g, b, args.length > 3 ? args[3] : 1];\n };\n\n var oklch2rgb_1 = oklch2rgb;\n\n var unpack = utils.unpack;\n var type$7 = utils.type;\n var chroma$5 = chroma_1;\n var Color$n = Color_1;\n var input = input$h;\n\n var rgb2oklch = rgb2oklch_1;\n\n Color$n.prototype.oklch = function () {\n return rgb2oklch(this._rgb);\n };\n\n chroma$5.oklch = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return new (Function.prototype.bind.apply( Color$n, [ null ].concat( args, ['oklch']) ));\n };\n\n input.format.oklch = oklch2rgb_1;\n\n input.autodetect.push({\n p: 3,\n test: function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n args = unpack(args, 'oklch');\n if (type$7(args) === 'array' && args.length === 3) {\n return 'oklch';\n }\n }\n });\n\n var Color$m = Color_1;\n var type$6 = utils.type;\n\n Color$m.prototype.alpha = function(a, mutate) {\n if ( mutate === void 0 ) mutate=false;\n\n if (a !== undefined && type$6(a) === 'number') {\n if (mutate) {\n this._rgb[3] = a;\n return this;\n }\n return new Color$m([this._rgb[0], this._rgb[1], this._rgb[2], a], 'rgb');\n }\n return this._rgb[3];\n };\n\n var Color$l = Color_1;\n\n Color$l.prototype.clipped = function() {\n return this._rgb._clipped || false;\n };\n\n var Color$k = Color_1;\n var LAB_CONSTANTS$1 = labConstants;\n\n Color$k.prototype.darken = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \tvar me = this;\n \tvar lab = me.lab();\n \tlab[0] -= LAB_CONSTANTS$1.Kn * amount;\n \treturn new Color$k(lab, 'lab').alpha(me.alpha(), true);\n };\n\n Color$k.prototype.brighten = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \treturn this.darken(-amount);\n };\n\n Color$k.prototype.darker = Color$k.prototype.darken;\n Color$k.prototype.brighter = Color$k.prototype.brighten;\n\n var Color$j = Color_1;\n\n Color$j.prototype.get = function (mc) {\n var ref = mc.split('.');\n var mode = ref[0];\n var channel = ref[1];\n var src = this[mode]();\n if (channel) {\n var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) { return src[i]; }\n throw new Error((\"unknown channel \" + channel + \" in mode \" + mode));\n } else {\n return src;\n }\n };\n\n var Color$i = Color_1;\n var type$5 = utils.type;\n var pow$6 = Math.pow;\n\n var EPS = 1e-7;\n var MAX_ITER = 20;\n\n Color$i.prototype.luminance = function(lum) {\n if (lum !== undefined && type$5(lum) === 'number') {\n if (lum === 0) {\n // return pure black\n return new Color$i([0,0,0,this._rgb[3]], 'rgb');\n }\n if (lum === 1) {\n // return pure white\n return new Color$i([255,255,255,this._rgb[3]], 'rgb');\n }\n // compute new color using...\n var cur_lum = this.luminance();\n var mode = 'rgb';\n var max_iter = MAX_ITER;\n\n var test = function (low, high) {\n var mid = low.interpolate(high, 0.5, mode);\n var lm = mid.luminance();\n if (Math.abs(lum - lm) < EPS || !max_iter--) {\n // close enough\n return mid;\n }\n return lm > lum ? test(low, mid) : test(mid, high);\n };\n\n var rgb = (cur_lum > lum ? test(new Color$i([0,0,0]), this) : test(this, new Color$i([255,255,255]))).rgb();\n return new Color$i(rgb.concat( [this._rgb[3]]));\n }\n return rgb2luminance.apply(void 0, (this._rgb).slice(0,3));\n };\n\n\n var rgb2luminance = function (r,g,b) {\n // relative luminance\n // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n r = luminance_x(r);\n g = luminance_x(g);\n b = luminance_x(b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n };\n\n var luminance_x = function (x) {\n x /= 255;\n return x <= 0.03928 ? x/12.92 : pow$6((x+0.055)/1.055, 2.4);\n };\n\n var interpolator$1 = {};\n\n var Color$h = Color_1;\n var type$4 = utils.type;\n var interpolator = interpolator$1;\n\n var mix$1 = function (col1, col2, f) {\n if ( f === void 0 ) f=0.5;\n var rest = [], len = arguments.length - 3;\n while ( len-- > 0 ) rest[ len ] = arguments[ len + 3 ];\n\n var 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$4(col1) !== 'object') { col1 = new Color$h(col1); }\n if (type$4(col2) !== 'object') { col2 = new Color$h(col2); }\n return interpolator[mode](col1, col2, f)\n .alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));\n };\n\n var Color$g = Color_1;\n var mix = mix$1;\n\n Color$g.prototype.mix =\n Color$g.prototype.interpolate = function(col2, f) {\n \tif ( f === void 0 ) f=0.5;\n \tvar rest = [], len = arguments.length - 2;\n \twhile ( len-- > 0 ) rest[ len ] = arguments[ len + 2 ];\n\n \treturn mix.apply(void 0, [ this, col2, f ].concat( rest ));\n };\n\n var Color$f = Color_1;\n\n Color$f.prototype.premultiply = function(mutate) {\n \tif ( mutate === void 0 ) mutate=false;\n\n \tvar rgb = this._rgb;\n \tvar a = rgb[3];\n \tif (mutate) {\n \t\tthis._rgb = [rgb[0]*a, rgb[1]*a, rgb[2]*a, a];\n \t\treturn this;\n \t} else {\n \t\treturn new Color$f([rgb[0]*a, rgb[1]*a, rgb[2]*a, a], 'rgb');\n \t}\n };\n\n var Color$e = Color_1;\n var LAB_CONSTANTS = labConstants;\n\n Color$e.prototype.saturate = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \tvar me = this;\n \tvar lch = me.lch();\n \tlch[1] += LAB_CONSTANTS.Kn * amount;\n \tif (lch[1] < 0) { lch[1] = 0; }\n \treturn new Color$e(lch, 'lch').alpha(me.alpha(), true);\n };\n\n Color$e.prototype.desaturate = function(amount) {\n \tif ( amount === void 0 ) amount=1;\n\n \treturn this.saturate(-amount);\n };\n\n var Color$d = Color_1;\n var type$3 = utils.type;\n\n Color$d.prototype.set = function (mc, value, mutate) {\n if ( mutate === void 0 ) mutate = false;\n\n var ref = mc.split('.');\n var mode = ref[0];\n var channel = ref[1];\n var src = this[mode]();\n if (channel) {\n var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) {\n if (type$3(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$3(value) === 'number') {\n src[i] = value;\n } else {\n throw new Error(\"unsupported value for Color.set\");\n }\n var out = new Color$d(src, mode);\n if (mutate) {\n this._rgb = out._rgb;\n return this;\n }\n return out;\n }\n throw new Error((\"unknown channel \" + channel + \" in mode \" + mode));\n } else {\n return src;\n }\n };\n\n var Color$c = Color_1;\n\n var rgb = function (col1, col2, f) {\n var xyz0 = col1._rgb;\n var xyz1 = col2._rgb;\n return new Color$c(\n xyz0[0] + f * (xyz1[0]-xyz0[0]),\n xyz0[1] + f * (xyz1[1]-xyz0[1]),\n xyz0[2] + f * (xyz1[2]-xyz0[2]),\n 'rgb'\n )\n };\n\n // register interpolator\n interpolator$1.rgb = rgb;\n\n var Color$b = Color_1;\n var sqrt$2 = Math.sqrt;\n var pow$5 = Math.pow;\n\n var lrgb = function (col1, col2, f) {\n var ref = col1._rgb;\n var x1 = ref[0];\n var y1 = ref[1];\n var z1 = ref[2];\n var ref$1 = col2._rgb;\n var x2 = ref$1[0];\n var y2 = ref$1[1];\n var z2 = ref$1[2];\n return new Color$b(\n sqrt$2(pow$5(x1,2) * (1-f) + pow$5(x2,2) * f),\n sqrt$2(pow$5(y1,2) * (1-f) + pow$5(y2,2) * f),\n sqrt$2(pow$5(z1,2) * (1-f) + pow$5(z2,2) * f),\n 'rgb'\n )\n };\n\n // register interpolator\n interpolator$1.lrgb = lrgb;\n\n var Color$a = Color_1;\n\n var lab = function (col1, col2, f) {\n var xyz0 = col1.lab();\n var xyz1 = col2.lab();\n return new Color$a(\n xyz0[0] + f * (xyz1[0]-xyz0[0]),\n xyz0[1] + f * (xyz1[1]-xyz0[1]),\n xyz0[2] + f * (xyz1[2]-xyz0[2]),\n 'lab'\n )\n };\n\n // register interpolator\n interpolator$1.lab = lab;\n\n var Color$9 = Color_1;\n\n var _hsx = function (col1, col2, f, m) {\n var assign, assign$1;\n\n var xyz0, xyz1;\n if (m === 'hsl') {\n xyz0 = col1.hsl();\n xyz1 = col2.hsl();\n } else if (m === 'hsv') {\n xyz0 = col1.hsv();\n xyz1 = col2.hsv();\n } else if (m === 'hcg') {\n xyz0 = col1.hcg();\n xyz1 = col2.hcg();\n } else if (m === 'hsi') {\n xyz0 = col1.hsi();\n xyz1 = col2.hsi();\n } else if (m === 'lch' || m === 'hcl') {\n m = 'hcl';\n xyz0 = col1.hcl();\n xyz1 = col2.hcl();\n } else if (m === 'oklch') {\n xyz0 = col1.oklch().reverse();\n xyz1 = col2.oklch().reverse();\n }\n\n var hue0, hue1, sat0, sat1, lbv0, lbv1;\n if (m.substr(0, 1) === 'h' || m === 'oklch') {\n (assign = xyz0, hue0 = assign[0], sat0 = assign[1], lbv0 = assign[2]);\n (assign$1 = xyz1, hue1 = assign$1[0], sat1 = assign$1[1], lbv1 = assign$1[2]);\n }\n\n var sat, hue, lbv, dh;\n\n if (!isNaN(hue0) && !isNaN(hue1)) {\n // both colors have hue\n if (hue1 > hue0 && hue1 - hue0 > 180) {\n dh = hue1 - (hue0 + 360);\n } else if (hue1 < hue0 && hue0 - hue1 > 180) {\n dh = hue1 + 360 - hue0;\n } else {\n dh = hue1 - hue0;\n }\n hue = hue0 + f * dh;\n } else if (!isNaN(hue0)) {\n hue = hue0;\n if ((lbv1 == 1 || lbv1 == 0) && m != 'hsv') { sat = sat0; }\n } else if (!isNaN(hue1)) {\n hue = hue1;\n if ((lbv0 == 1 || lbv0 == 0) && m != 'hsv') { sat = sat1; }\n } else {\n hue = Number.NaN;\n }\n\n if (sat === undefined) { sat = sat0 + f * (sat1 - sat0); }\n lbv = lbv0 + f * (lbv1 - lbv0);\n return m === 'oklch' ? new Color$9([lbv, sat, hue], m) : new Color$9([hue, sat, lbv], m);\n };\n\n var interpolate_hsx$5 = _hsx;\n\n var lch = function (col1, col2, f) {\n \treturn interpolate_hsx$5(col1, col2, f, 'lch');\n };\n\n // register interpolator\n interpolator$1.lch = lch;\n interpolator$1.hcl = lch;\n\n var Color$8 = Color_1;\n\n var num = function (col1, col2, f) {\n var c1 = col1.num();\n var c2 = col2.num();\n return new Color$8(c1 + f * (c2-c1), 'num')\n };\n\n // register interpolator\n interpolator$1.num = num;\n\n var interpolate_hsx$4 = _hsx;\n\n var hcg = function (col1, col2, f) {\n \treturn interpolate_hsx$4(col1, col2, f, 'hcg');\n };\n\n // register interpolator\n interpolator$1.hcg = hcg;\n\n var interpolate_hsx$3 = _hsx;\n\n var hsi = function (col1, col2, f) {\n \treturn interpolate_hsx$3(col1, col2, f, 'hsi');\n };\n\n // register interpolator\n interpolator$1.hsi = hsi;\n\n var interpolate_hsx$2 = _hsx;\n\n var hsl = function (col1, col2, f) {\n \treturn interpolate_hsx$2(col1, col2, f, 'hsl');\n };\n\n // register interpolator\n interpolator$1.hsl = hsl;\n\n var interpolate_hsx$1 = _hsx;\n\n var hsv = function (col1, col2, f) {\n \treturn interpolate_hsx$1(col1, col2, f, 'hsv');\n };\n\n // register interpolator\n interpolator$1.hsv = hsv;\n\n var Color$7 = Color_1;\n\n var oklab = function (col1, col2, f) {\n var xyz0 = col1.oklab();\n var xyz1 = col2.oklab();\n return new Color$7(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'oklab'\n );\n };\n\n // register interpolator\n interpolator$1.oklab = oklab;\n\n var interpolate_hsx = _hsx;\n\n var oklch = function (col1, col2, f) {\n return interpolate_hsx(col1, col2, f, 'oklch');\n };\n\n // register interpolator\n interpolator$1.oklch = oklch;\n\n var Color$6 = Color_1;\n var clip_rgb$1 = utils.clip_rgb;\n var pow$4 = Math.pow;\n var sqrt$1 = Math.sqrt;\n var PI$1 = Math.PI;\n var cos$2 = Math.cos;\n var sin$2 = Math.sin;\n var atan2$1 = Math.atan2;\n\n var average = function (colors, mode, weights) {\n if ( mode === void 0 ) mode='lrgb';\n if ( weights === void 0 ) weights=null;\n\n var l = colors.length;\n if (!weights) { weights = Array.from(new Array(l)).map(function () { return 1; }); }\n // normalize weights\n var k = l / weights.reduce(function(a, b) { return a + b; });\n weights.forEach(function (w,i) { weights[i] *= k; });\n // convert colors to Color objects\n colors = colors.map(function (c) { return new Color$6(c); });\n if (mode === 'lrgb') {\n return _average_lrgb(colors, weights)\n }\n var first = colors.shift();\n var xyz = first.get(mode);\n var cnt = [];\n var dx = 0;\n var dy = 0;\n // initial color\n for (var 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 var A = xyz[i] / 180 * PI$1;\n dx += cos$2(A) * weights[0];\n dy += sin$2(A) * weights[0];\n }\n }\n\n var alpha = first.alpha() * weights[0];\n colors.forEach(function (c,ci) {\n var xyz2 = c.get(mode);\n alpha += c.alpha() * weights[ci+1];\n for (var i=0; i<xyz.length; i++) {\n if (!isNaN(xyz2[i])) {\n cnt[i] += weights[ci+1];\n if (mode.charAt(i) === 'h') {\n var A = xyz2[i] / 180 * PI$1;\n dx += cos$2(A) * weights[ci+1];\n dy += sin$2(A) * weights[ci+1];\n } else {\n xyz[i] += xyz2[i] * weights[ci+1];\n }\n }\n }\n });\n\n for (var i$1=0; i$1<xyz.length; i$1++) {\n if (mode.charAt(i$1) === 'h') {\n var A$1 = atan2$1(dy / cnt[i$1], dx / cnt[i$1]) / PI$1 * 180;\n while (A$1 < 0) { A$1 += 360; }\n while (A$1 >= 360) { A$1 -= 360; }\n xyz[i$1] = A$1;\n } else {\n xyz[i$1] = xyz[i$1]/cnt[i$1];\n }\n }\n alpha /= l;\n return (new Color$6(xyz, mode)).alpha(alpha > 0.99999 ? 1 : alpha, true);\n };\n\n\n var _average_lrgb = function (colors, weights) {\n var l = colors.length;\n var xyz = [0,0,0,0];\n for (var i=0; i < colors.length; i++) {\n var col = colors[i];\n var f = weights[i] / l;\n var rgb = col._rgb;\n xyz[0] += pow$4(rgb[0],2) * f;\n xyz[1] += pow$4(rgb[1],2) * f;\n xyz[2] += pow$4(rgb[2],2) * f;\n xyz[3] += rgb[3] * f;\n }\n xyz[0] = sqrt$1(xyz[0]);\n xyz[1] = sqrt$1(xyz[1]);\n xyz[2] = sqrt$1(xyz[2]);\n if (xyz[3] > 0.9999999) { xyz[3] = 1; }\n return new Color$6(clip_rgb$1(xyz));\n };\n\n // minimal multi-purpose interface\n\n // @requires utils color analyze\n\n var chroma$4 = chroma_1;\n var type$2 = utils.type;\n\n var pow$3 = Math.pow;\n\n var scale$2 = function(colors) {\n\n // constructor\n var _mode = 'rgb';\n var _nacol = chroma$4('#ccc');\n var _spread = 0;\n // const _fixed = false;\n var _domain = [0, 1];\n var _pos = [];\n var _padding = [0,0];\n var _classes = false;\n var _colors = [];\n var _out = false;\n var _min = 0;\n var _max = 1;\n var _correctLightness = false;\n var _colorCache = {};\n var _useCache = true;\n var _gamma = 1;\n\n // private methods\n\n var setColors = function(colors) {\n colors = colors || ['#fff', '#000'];\n if (colors && type$2(colors) === 'string' && chroma$4.brewer &&\n chroma$4.brewer[colors.toLowerCase()]) {\n colors = chroma$4.brewer[colors.toLowerCase()];\n }\n if (type$2(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 (var c=0; c<colors.length; c++) {\n colors[c] = chroma$4(colors[c]);\n }\n // auto-fill color position\n _pos.length = 0;\n for (var c$1=0; c$1<colors.length; c$1++) {\n _pos.push(c$1/(colors.length-1));\n }\n }\n resetCache();\n return _colors = colors;\n };\n\n var getClass = function(value) {\n if (_classes != null) {\n var n = _classes.length-1;\n var i = 0;\n while (i < n && value >= _classes[i]) {\n i++;\n }\n return i-1;\n }\n return 0;\n };\n\n var tMapLightness = function (t) { return t; };\n var tMapDomain = function (t) { return 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 var getColor = function(val, bypassMap) {\n var col, t;\n if (bypassMap == null) { bypassMap = false; }\n if (isNaN(val) || (val === null)) { return _nacol; }\n if (!bypassMap) {\n if (_classes && (_classes.length > 2)) {\n // find the class\n var c = getClass(val);\n t = c / (_classes.length-2);\n } else if (_max !== _min) {\n // just interpolate between min/max\n t = (val - _min) / (_max - _min);\n } else {\n t = 1;\n }\n } else {\n t = val;\n }\n\n // domain map\n t = tMapDomain(t);\n\n if (!bypassMap) {\n t = tMapLightness(t); // lightness correction\n }\n\n if (_gamma !== 1) { t = pow$3(t, _gamma); }\n\n t = _padding[0] + (t * (1 - _padding[0] - _padding[1]));\n\n t = Math.min(1, Math.max(0, t));\n\n var k = Math.floor(t * 10000);\n\n if (_useCache && _colorCache[k]) {\n col = _colorCache[k];\n } else {\n if (type$2(_colors) === 'array') {\n //for i in [0.._pos.length-1]\n for (var i=0; i<_pos.length; i++) {\n var 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$4.interpolate(_colors[i], _colors[i+1], t, _mode);\n break;\n }\n }\n } else if (type$2(_colors) === 'function') {\n col = _colors(t);\n }\n if (_useCache) { _colorCache[k] = col; }\n }\n return col;\n };\n\n var resetCache = function () { return _colorCache = {}; };\n\n setColors(colors);\n\n // public interface\n\n var f = function(v) {\n var c = chroma$4(getColor(v));\n if (_out && c[_out]) { return c[_out](); } else { return c; }\n };\n\n f.classes = function(classes) {\n if (classes != null) {\n if (type$2(classes) === 'array') {\n _classes = classes;\n _domain = [classes[0], classes[classes.length-1]];\n } else {\n var d = chroma$4.analyze(_domain);\n if (classes === 0) {\n _classes = [d.min, d.max];\n } else {\n _classes = chroma$4.limits(d, 'e', classes);\n }\n }\n return f;\n }\n return _classes;\n };\n\n\n f.domain = function(domain) {\n if (!arguments.length) {\n return _domain;\n }\n _min = domain[0];\n _max = domain[domain.length-1];\n _pos = [];\n var k = _colors.length;\n if ((domain.length === k) && (_min !== _max)) {\n // update positions\n for (var i = 0, list = Array.from(domain); i < list.length; i += 1) {\n var d = list[i];\n\n _pos.push((d-_min) / (_max-_min));\n }\n } else {\n for (var c=0; c<k; c++) {\n _pos.push(c/(k-1));\n }\n if (domain.length > 2) {\n // set domain map\n var tOut = domain.map(function (d,i) { return i/(domain.length-1); });\n var tBreaks = domain.map(function (d) { return (d - _min) / (_max - _min); });\n if (!tBreaks.every(function (val, i) { return tOut[i] === val; })) {\n tMapDomain = function (t) {\n if (t <= 0 || t >= 1) { return t; }\n var i = 0;\n while (t >= tBreaks[i+1]) { i++; }\n var f = (t - tBreaks[i]) / (tBreaks[i+1] - tBreaks[i]);\n var out = tOut[i] + f * (tOut[i+1] - tOut[i]);\n return out;\n };\n }\n\n }\n }\n _domain = [_min, _max];\n return f;\n };\n\n f.mode = function(_m) {\n if (!arguments.length) {\n return _mode;\n }\n _mode = _m;\n resetCache();\n return f;\n };\n\n f.range = function(colors, _pos) {\n setColors(colors);\n return f;\n };\n\n f.out = function(_o) {\n _out = _o;\n return f;\n };\n\n f.spread = function(val) {\n if (!arguments.length) {\n return _spread;\n }\n _spread = val;\n return f;\n };\n\n f.correctLightness = function(v) {\n if (v == null) { v = true; }\n _correctLightness = v;\n resetCache();\n if (_correctLightness) {\n tMapLightness = function(t) {\n var L0 = getColor(0, true).lab()[0];\n var L1 = getColor(1, true).lab()[0];\n var pol = L0 > L1;\n var L_actual = getColor(t, true).lab()[0];\n var L_ideal = L0 + ((L1 - L0) * t);\n var L_diff = L_actual - L_ideal;\n var t0 = 0;\n var t1 = 1;\n var max_iter = 20;\n while ((Math.abs(L_diff) > 1e-2) && (max_iter-- > 0)) {\n (function() {\n if (pol) { L_diff *= -1; }\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 = function (t) { return t; };\n }\n return f;\n };\n\n f.padding = function(p) {\n if (p != null) {\n if (type$2(p) === 'number') {\n p = [p,p];\n }\n _padding = p;\n return f;\n } else {\n return _padding;\n }\n };\n\n f.colors = function(numColors, out) {\n // If no arguments are given, return the original colors that were provided\n if (arguments.length < 2) { out = 'hex'; }\n var result = [];\n\n if (arguments.length === 0) {\n result = _colors.slice(0);\n\n } else if (numColors === 1) {\n result = [f(0.5)];\n\n } else if (numColors > 1) {\n var dm = _domain[0];\n var dd = _domain[1] - dm;\n result = __range__(0, numColors, false).map(function (i) { return f( dm + ((i/(numColors-1)) * dd) ); });\n\n } else { // returns all colors based on the defined classes\n colors = [];\n var samples = [];\n if (_classes && (_classes.length > 2)) {\n for (var 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(function (v) { return f(v); });\n }\n\n if (chroma$4[out]) {\n result = result.map(function (c) { return c[out](); });\n }\n return result;\n };\n\n f.cache = function(c) {\n if (c != null) {\n _useCache = c;\n return f;\n } else {\n return _useCache;\n }\n };\n\n f.gamma = function(g) {\n if (g != null) {\n _gamma = g;\n return f;\n } else {\n return _gamma;\n }\n };\n\n f.nodata = function(d) {\n if (d != null) {\n _nacol = chroma$4(d);\n return f;\n } else {\n return _nacol;\n }\n };\n\n return f;\n };\n\n function __range__(left, right, inclusive) {\n var range = [];\n var ascending = left < right;\n var end = !inclusive ? right : ascending ? right + 1 : right - 1;\n for (var i = left; ascending ? i < end : i > end; ascending ? i++ : i--) {\n range.push(i);\n }\n return range;\n }\n\n //\n // interpolates between a set of colors uzing a bezier spline\n //\n\n // @requires utils lab\n var Color$5 = Color_1;\n\n var scale$1 = scale$2;\n\n // nth row of the pascal triangle\n var binom_row = function(n) {\n var row = [1, 1];\n for (var i = 1; i < n; i++) {\n var newrow = [1];\n for (var j = 1; j <= row.length; j++) {\n newrow[j] = (row[j] || 0) + row[j - 1];\n }\n row = newrow;\n }\n return row;\n };\n\n var bezier = function(colors) {\n var assign, assign$1, assign$2;\n\n var I, lab0, lab1, lab2;\n colors = colors.map(function (c) { return new Color$5(c); });\n if (colors.length === 2) {\n // linear interpolation\n (assign = colors.map(function (c) { return c.lab(); }), lab0 = assign[0], lab1 = assign[1]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return lab0[i] + (t * (lab1[i] - lab0[i])); }));\n return new Color$5(lab, 'lab');\n };\n } else if (colors.length === 3) {\n // quadratic bezier interpolation\n (assign$1 = colors.map(function (c) { return c.lab(); }), lab0 = assign$1[0], lab1 = assign$1[1], lab2 = assign$1[2]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return ((1-t)*(1-t) * lab0[i]) + (2 * (1-t) * t * lab1[i]) + (t * t * lab2[i]); }));\n return new Color$5(lab, 'lab');\n };\n } else if (colors.length === 4) {\n // cubic bezier interpolation\n var lab3;\n (assign$2 = colors.map(function (c) { return c.lab(); }), lab0 = assign$2[0], lab1 = assign$2[1], lab2 = assign$2[2], lab3 = assign$2[3]);\n I = function(t) {\n var lab = ([0, 1, 2].map(function (i) { return ((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$5(lab, 'lab');\n };\n } else if (colors.length >= 5) {\n // general case (degree n bezier)\n var labs, row, n;\n labs = colors.map(function (c) { return c.lab(); });\n n = colors.length - 1;\n row = binom_row(n);\n I = function (t) {\n var u = 1 - t;\n var lab = ([0, 1, 2].map(function (i) { return labs.reduce(function (sum, el, j) { return (sum + row[j] * Math.pow( u, (n - j) ) * Math.pow( t, j ) * el[i]); }, 0); }));\n return new Color$5(lab, 'lab');\n };\n } else {\n throw new RangeError(\"No point in running bezier with only one color.\")\n }\n return I;\n };\n\n var bezier_1 = function (colors) {\n var f = bezier(colors);\n f.scale = function () { return scale$1(f); };\n return f;\n };\n\n /*\n * interpolates between a set of colors uzing a bezier spline\n * blend mode formulas taken from http://www.venture-ware.com/kevin/coding/lets-learn-math-photoshop-blend-modes/\n */\n\n var chroma$3 = chroma_1;\n\n var blend = function (bottom, top, mode) {\n if (!blend[mode]) {\n throw new Error('unknown blend mode ' + mode);\n }\n return blend[mode](bottom, top);\n };\n\n var blend_f = function (f) { return function (bottom,top) {\n var c0 = chroma$3(top).rgb();\n var c1 = chroma$3(bottom).rgb();\n return chroma$3.rgb(f(c0, c1));\n }; };\n\n var each = function (f) { return function (c0, c1) {\n var out = [];\n out[0] = f(c0[0], c1[0]);\n out[1] = f(c0[1], c1[1]);\n out[2] = f(c0[2], c1[2]);\n return out;\n }; };\n\n var normal = function (a) { return a; };\n var multiply = function (a,b) { return a * b / 255; };\n var darken = function (a,b) { return a > b ? b : a; };\n var lighten = function (a,b) { return a > b ? a : b; };\n var screen = function (a,b) { return 255 * (1 - (1-a/255) * (1-b/255)); };\n var overlay = function (a,b) { return b < 128 ? 2 * a * b / 255 : 255 * (1 - 2 * (1 - a / 255 ) * ( 1 - b / 255 )); };\n var burn = function (a,b) { return 255 * (1 - (1 - b / 255) / (a/255)); };\n var dodge = function (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\n blend.normal = blend_f(each(normal));\n blend.multiply = blend_f(each(multiply));\n blend.screen = blend_f(each(screen));\n blend.overlay = blend_f(each(overlay));\n blend.darken = blend_f(each(darken));\n blend.lighten = blend_f(each(lighten));\n blend.dodge = blend_f(each(dodge));\n blend.burn = blend_f(each(burn));\n // blend.add = blend_f(each(add));\n\n var blend_1 = blend;\n\n // cubehelix interpolation\n // based on D.A. Green \"A colour scheme for the display of astronomical intensity images\"\n // http://astron-soc.in/bulletin/11June/289392011.pdf\n\n var type$1 = utils.type;\n var clip_rgb = utils.clip_rgb;\n var TWOPI = utils.TWOPI;\n var pow$2 = Math.pow;\n var sin$1 = Math.sin;\n var cos$1 = Math.cos;\n var chroma$2 = chroma_1;\n\n var cubehelix = function(start, rotations, hue, gamma, lightness) {\n if ( start === void 0 ) start=300;\n if ( rotations === void 0 ) rotations=-1.5;\n if ( hue === void 0 ) hue=1;\n if ( gamma === void 0 ) gamma=1;\n if ( lightness === void 0 ) lightness=[0,1];\n\n var dh = 0, dl;\n if (type$1(lightness) === 'array') {\n dl = lightness[1] - lightness[0];\n } else {\n dl = 0;\n lightness = [lightness, lightness];\n }\n\n var f = function(fract) {\n var a = TWOPI * (((start+120)/360) + (rotations * fract));\n var l = pow$2(lightness[0] + (dl * fract), gamma);\n var h = dh !== 0 ? hue[0] + (fract * dh) : hue;\n var amp = (h * l * (1-l)) / 2;\n var cos_a = cos$1(a);\n var sin_a = sin$1(a);\n var r = l + (amp * ((-0.14861 * cos_a) + (1.78277* sin_a)));\n var g = l + (amp * ((-0.29227 * cos_a) - (0.90649* sin_a)));\n var b = l + (amp * (+1.97294 * cos_a));\n return chroma$2(clip_rgb([r*255,g*255,b*255,1]));\n };\n\n f.start = function(s) {\n if ((s == null)) { return start; }\n start = s;\n return f;\n };\n\n f.rotations = function(r) {\n if ((r == null)) { return rotations; }\n rotations = r;\n return f;\n };\n\n f.gamma = function(g) {\n if ((g == null)) { return gamma; }\n gamma = g;\n return f;\n };\n\n f.hue = function(h) {\n if ((h == null)) { return hue; }\n hue = h;\n if (type$1(hue) === 'array') {\n dh = hue[1] - hue[0];\n if (dh === 0) { hue = hue[1]; }\n } else {\n dh = 0;\n }\n return f;\n };\n\n f.lightness = function(h) {\n if ((h == null)) { return lightness; }\n if (type$1(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\n f.scale = function () { return chroma$2.scale(f); };\n\n f.hue(hue);\n\n return f;\n };\n\n var Color$4 = Color_1;\n var digits = '0123456789abcdef';\n\n var floor$1 = Math.floor;\n var random = Math.random;\n\n var random_1 = function () {\n var code = '#';\n for (var i=0; i<6; i++) {\n code += digits.charAt(floor$1(random() * 16));\n }\n return new Color$4(code, 'hex');\n };\n\n var type = type$p;\n var log = Math.log;\n var pow$1 = Math.pow;\n var floor = Math.floor;\n var abs$1 = Math.abs;\n\n\n var analyze = function (data, key) {\n if ( key === void 0 ) key=null;\n\n var 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(function (val) {\n if (key && type(val) === 'object') { val = val[key]; }\n if (val !== undefined && val !== null && !isNaN(val)) {\n r.values.push(val);\n r.sum += val;\n if (val < r.min) { r.min = val; }\n if (val > r.max) { r.max = val; }\n r.count += 1;\n }\n });\n\n r.domain = [r.min, r.max];\n\n r.limits = function (mode, num) { return limits(r, mode, num); };\n\n return r;\n };\n\n\n var limits = function (data, mode, num) {\n if ( mode === void 0 ) mode='equal';\n if ( num === void 0 ) num=7;\n\n if (type(data) == 'array') {\n data = analyze(data);\n }\n var min = data.min;\n var max = data.max;\n var values = data.values.sort(function (a,b) { return a-b; });\n\n if (num === 1) { return [min,max]; }\n\n var limits = [];\n\n if (mode.substr(0,1) === 'c') { // continuous\n limits.push(min);\n limits.push(max);\n }\n\n if (mode.substr(0,1) === 'e') { // equal interval\n limits.push(min);\n for (var i=1; i<num; i++) {\n limits.push(min+((i/num)*(max-min)));\n }\n limits.push(max);\n }\n\n else if (mode.substr(0,1) === 'l') { // log scale\n if (min <= 0) {\n throw new Error('Logarithmic scales are only possible for values > 0');\n }\n var min_log = Math.LOG10E * log(min);\n var max_log = Math.LOG10E * log(max);\n limits.push(min);\n for (var i$1=1; i$1<num; i$1++) {\n limits.push(pow$1(10, min_log + ((i$1/num) * (max_log - min_log))));\n }\n limits.push(max);\n }\n\n else if (mode.substr(0,1) === 'q') { // quantile scale\n limits.push(min);\n for (var i$2=1; i$2<num; i$2++) {\n var p = ((values.length-1) * i$2)/num;\n var pb = floor(p);\n if (pb === p) {\n limits.push(values[pb]);\n } else { // p > pb\n var pr = p - pb;\n limits.push((values[pb]*(1-pr)) + (values[pb+1]*pr));\n }\n }\n limits.push(max);\n\n }\n\n else if (mode.substr(0,1) === 'k') { // 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 var cluster;\n var n = values.length;\n var assignments = new Array(n);\n var clusterSizes = new Array(num);\n var repeat = true;\n var nb_iters = 0;\n var centroids = null;\n\n // get seed values\n centroids = [];\n centroids.push(min);\n for (var i$3=1; i$3<num; i$3++) {\n centroids.push(min + ((i$3/num) * (max-min)));\n }\n centroids.push(max);\n\n while (repeat) {\n // assignment step\n for (var j=0; j<num; j++) {\n clusterSizes[j] = 0;\n }\n for (var i$4=0; i$4<n; i$4++) {\n var value = values[i$4];\n var mindist = Number.MAX_VALUE;\n var best = (void 0);\n for (var j$1=0; j$1<num; j$1++) {\n var dist = abs$1(centroids[j$1]-value);\n if (dist < mindist) {\n mindist = dist;\n best = j$1;\n }\n clusterSizes[best]++;\n assignments[i$4] = best;\n }\n }\n\n // update centroids step\n var newCentroids = new Array(num);\n for (var j$2=0; j$2<num; j$2++) {\n newCentroids[j$2] = null;\n }\n for (var i$5=0; i$5<n; i$5++) {\n cluster = assignments[i$5];\n if (newCentroids[cluster] === null) {\n newCentroids[cluster] = values[i$5];\n } else {\n newCentroids[cluster] += values[i$5];\n }\n }\n for (var j$3=0; j$3<num; j$3++) {\n newCentroids[j$3] *= 1/clusterSizes[j$3];\n }\n\n // check convergence\n repeat = false;\n for (var j$4=0; j$4<num; j$4++) {\n if (newCentroids[j$4] !== centroids[j$4]) {\n repeat = true;\n break;\n }\n }\n\n centroids = newCentroids;\n nb_iters++;\n\n if (nb_iters > 200) {\n repeat = false;\n }\n }\n\n // finished k-means clustering\n // the next part is borrowed from gabrielflor.it\n var kClusters = {};\n for (var j$5=0; j$5<num; j$5++) {\n kClusters[j$5] = [];\n }\n for (var i$6=0; i$6<n; i$6++) {\n cluster = assignments[i$6];\n kClusters[cluster].push(values[i$6]);\n }\n var tmpKMeansBreaks = [];\n for (var j$6=0; j$6<num; j$6++) {\n tmpKMeansBreaks.push(kClusters[j$6][0]);\n tmpKMeansBreaks.push(kClusters[j$6][kClusters[j$6].length-1]);\n }\n tmpKMeansBreaks = tmpKMeansBreaks.sort(function (a,b){ return a-b; });\n limits.push(tmpKMeansBreaks[0]);\n for (var i$7=1; i$7 < tmpKMeansBreaks.length; i$7+= 2) {\n var v = tmpKMeansBreaks[i$7];\n if (!isNaN(v) && (limits.indexOf(v) === -1)) {\n limits.push(v);\n }\n }\n }\n return limits;\n };\n\n var analyze_1 = {analyze: analyze, limits: limits};\n\n var Color$3 = Color_1;\n\n\n var contrast = function (a, b) {\n // WCAG contrast ratio\n // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef\n a = new Color$3(a);\n b = new Color$3(b);\n var l1 = a.luminance();\n var l2 = b.luminance();\n return l1 > l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);\n };\n\n var Color$2 = Color_1;\n var sqrt = Math.sqrt;\n var pow = Math.pow;\n var min = Math.min;\n var max = Math.max;\n var atan2 = Math.atan2;\n var abs = Math.abs;\n var cos = Math.cos;\n var sin = Math.sin;\n var exp = Math.exp;\n var PI = Math.PI;\n\n var deltaE = function(a, b, Kl, Kc, Kh) {\n if ( Kl === void 0 ) Kl=1;\n if ( Kc === void 0 ) Kc=1;\n if ( Kh === void 0 ) Kh=1;\n\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$2(a);\n b = new Color$2(b);\n var ref = Array.from(a.lab());\n var L1 = ref[0];\n var a1 = ref[1];\n var b1 = ref[2];\n var ref$1 = Array.from(b.lab());\n var L2 = ref$1[0];\n var a2 = ref$1[1];\n var b2 = ref$1[2];\n var avgL = (L1 + L2)/2;\n var C1 = sqrt(pow(a1, 2) + pow(b1, 2));\n var C2 = sqrt(pow(a2, 2) + pow(b2, 2));\n var avgC = (C1 + C2)/2;\n var G = 0.5*(1-sqrt(pow(avgC, 7)/(pow(avgC, 7) + pow(25, 7))));\n var a1p = a1*(1+G);\n var a2p = a2*(1+G);\n var C1p = sqrt(pow(a1p, 2) + pow(b1, 2));\n var C2p = sqrt(pow(a2p, 2) + pow(b2, 2));\n var avgCp = (C1p + C2p)/2;\n var arctan1 = rad2deg(atan2(b1, a1p));\n var arctan2 = rad2deg(atan2(b2, a2p));\n var h1p = arctan1 >= 0 ? arctan1 : arctan1 + 360;\n var h2p = arctan2 >= 0 ? arctan2 : arctan2 + 360;\n var avgHp = abs(h1p - h2p) > 180 ? (h1p + h2p + 360)/2 : (h1p + h2p)/2;\n var 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 var 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 var deltaL = L2 - L1;\n var deltaCp = C2p - C1p; \n var sl = 1 + (0.015*pow(avgL - 50, 2))/sqrt(20 + pow(avgL - 50, 2));\n var sc = 1 + 0.045*avgCp;\n var sh = 1 + 0.015*avgCp*T;\n var deltaTheta = 30*exp(-pow((avgHp - 275)/25, 2));\n var Rc = 2*sqrt(pow(avgCp, 7)/(pow(avgCp, 7) + pow(25, 7)));\n var Rt = -Rc*sin(2*deg2rad(deltaTheta));\n var 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 };\n\n var Color$1 = Color_1;\n\n // simple Euclidean distance\n var distance = function(a, b, mode) {\n if ( mode === void 0 ) mode='lab';\n\n // Delta E (CIE 1976)\n // see http://www.brucelindbloom.com/index.html?Equations.html\n a = new Color$1(a);\n b = new Color$1(b);\n var l1 = a.get(mode);\n var l2 = b.get(mode);\n var sum_sq = 0;\n for (var i in l1) {\n var d = (l1[i] || 0) - (l2[i] || 0);\n sum_sq += d*d;\n }\n return Math.sqrt(sum_sq);\n };\n\n var Color = Color_1;\n\n var valid = function () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n try {\n new (Function.prototype.bind.apply( Color, [ null ].concat( args) ));\n return true;\n } catch (e) {\n return false;\n }\n };\n\n // some pre-defined color scales:\n var chroma$1 = chroma_1;\n\n var scale = scale$2;\n\n var scales = {\n \tcool: function cool() { return scale([chroma$1.hsl(180,1,.9), chroma$1.hsl(250,.7,.4)]) },\n \thot: function hot() { return scale(['#000','#f00','#ff0','#fff']).mode('rgb') }\n };\n\n /**\n ColorBrewer colors for chroma.js\n\n Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The\n Pennsylvania State University.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software distributed\n under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n CONDITIONS OF ANY KIND, either express or implied. See the License for the\n specific language governing permissions and limitations under the License.\n */\n\n var colorbrewer = {\n // sequential\n OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],\n PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],\n BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],\n Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],\n BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],\n YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],\n YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],\n Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],\n RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],\n Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],\n YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],\n Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],\n GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],\n Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],\n YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],\n PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],\n Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],\n PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],\n Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],\n\n // diverging\n\n Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],\n RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],\n RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],\n PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],\n PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],\n RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],\n BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],\n RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],\n PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],\n\n // qualitative\n\n Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],\n Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],\n Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],\n Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],\n Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],\n Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],\n Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],\n Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2'],\n };\n\n // add lowercase aliases for case-insensitive matches\n for (var i = 0, list = Object.keys(colorbrewer); i < list.length; i += 1) {\n var key = list[i];\n\n colorbrewer[key.toLowerCase()] = colorbrewer[key];\n }\n\n var colorbrewer_1 = colorbrewer;\n\n var chroma = chroma_1;\n\n // feel free to comment out anything to rollup\n // a smaller chroma.js built\n\n // io --> convert colors\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // operators --> modify existing Colors\n\n\n\n\n\n\n\n\n\n\n // interpolators\n\n\n\n\n\n\n\n\n\n\n\n\n // generators -- > create new colors\n chroma.average = average;\n chroma.bezier = bezier_1;\n chroma.blend = blend_1;\n chroma.cubehelix = cubehelix;\n chroma.mix = chroma.interpolate = mix$1;\n chroma.random = random_1;\n chroma.scale = scale$2;\n\n // other utility methods\n chroma.analyze = analyze_1.analyze;\n chroma.contrast = contrast;\n chroma.deltaE = deltaE;\n chroma.distance = distance;\n chroma.limits = analyze_1.limits;\n chroma.valid = valid;\n\n // scale\n chroma.scales = scales;\n\n // colors\n chroma.colors = w3cx11_1;\n chroma.brewer = colorbrewer_1;\n\n var chroma_js = chroma;\n\n return chroma_js;\n\n}));\n","(function(context) {\n\n /**\n * Defines an available color.\n *\n * @typedef {Object} ColorSpec\n * @property {string=} name A name for the color, e.g., 'red'\n * @property {string} source The hex-based color string, e.g., '#FF0'\n * @property {RGB} rgb The {@link RGB} color values\n */\n\n /**\n * Describes a matched color.\n *\n * @typedef {Object} ColorMatch\n * @property {string} name The name of the matched color, e.g., 'red'\n * @property {string} value The hex-based color string, e.g., '#FF0'\n * @property {RGB} rgb The {@link RGB} color values.\n */\n\n /**\n * Provides the RGB breakdown of a color.\n *\n * @typedef {Object} RGB\n * @property {number} r The red component, from 0 to 255\n * @property {number} g The green component, from 0 to 255\n * @property {number} b The blue component, from 0 to 255\n */\n\n /**\n * Gets the nearest color, from the given list of {@link ColorSpec} objects\n * (which defaults to {@link nearestColor.DEFAULT_COLORS}).\n *\n * Probably you wouldn't call this method directly. Instead you'd get a custom\n * color matcher by calling {@link nearestColor.from}.\n *\n * @public\n * @param {RGB|string} needle Either an {@link RGB} color or a hex-based\n * string representing one, e.g., '#FF0'\n * @param {Array.<ColorSpec>=} colors An optional list of available colors\n * (defaults to {@link nearestColor.DEFAULT_COLORS})\n * @return {ColorMatch|string} If the colors in the provided list had names,\n * then a {@link ColorMatch} object with the name and (hex) value of the\n * nearest color from the list. Otherwise, simply the hex value.\n *\n * @example\n * nearestColor({ r: 200, g: 50, b: 50 }); // => '#f00'\n * nearestColor('#f11'); // => '#f00'\n * nearestColor('#f88'); // => '#f80'\n * nearestColor('#ffe'); // => '#ff0'\n * nearestColor('#efe'); // => '#ff0'\n * nearestColor('#abc'); // => '#808'\n * nearestColor('red'); // => '#f00'\n * nearestColor('foo'); // => throws\n */\n function nearestColor(needle, colors) {\n needle = parseColor(needle);\n\n if (!needle) {\n return null;\n }\n\n var distanceSq,\n minDistanceSq = Infinity,\n rgb,\n value;\n\n colors || (colors = nearestColor.DEFAULT_COLORS);\n\n for (var i = 0; i < colors.length; ++i) {\n rgb = colors[i].rgb;\n\n distanceSq = (\n Math.pow(needle.r - rgb.r, 2) +\n Math.pow(needle.g - rgb.g, 2) +\n Math.pow(needle.b - rgb.b, 2)\n );\n\n if (distanceSq < minDistanceSq) {\n minDistanceSq = distanceSq;\n value = colors[i];\n }\n }\n\n if (value.name) {\n return {\n name: value.name,\n value: value.source,\n rgb: value.rgb,\n distance: Math.sqrt(minDistanceSq)\n };\n }\n\n return value.source;\n }\n\n /**\n * Provides a matcher to find the nearest color based on the provided list of\n * available colors.\n *\n * @public\n * @param {Array.<string>|Object} availableColors An array of hex-based color\n * strings, or an object mapping color *names* to hex values.\n * @return {function(string):ColorMatch|string} A function with the same\n * behavior as {@link nearestColor}, but with the list of colors\n * predefined.\n *\n * @example\n * var colors = {\n * 'maroon': '#800',\n * 'light yellow': { r: 255, g: 255, b: 51 },\n * 'pale blue': '#def',\n * 'white': 'fff'\n * };\n *\n * var bgColors = [\n * '#eee',\n * '#444'\n * ];\n *\n * var invalidColors = {\n * 'invalid': 'foo'\n * };\n *\n * var getColor = nearestColor.from(colors);\n * var getBGColor = getColor.from(bgColors);\n * var getAnyColor = nearestColor.from(colors).or(bgColors);\n *\n * getColor('ffe');\n * // => { name: 'white', value: 'fff', rgb: { r: 255, g: 255, b: 255 }, distance: 17}\n *\n * getColor('#f00');\n * // => { name: 'maroon', value: '#800', rgb: { r: 136, g: 0, b: 0 }, distance: 119}\n *\n * getColor('#ff0');\n * // => { name: 'light yellow', value: '#ffff33', rgb: { r: 255, g: 255, b: 51 }, distance: 51}\n *\n * getBGColor('#fff'); // => '#eee'\n * getBGColor('#000'); // => '#444'\n *\n * getAnyColor('#f00');\n * // => { name: 'maroon', value: '#800', rgb: { r: 136, g: 0, b: 0 }, distance: 119}\n *\n * getAnyColor('#888'); // => '#444'\n *\n * nearestColor.from(invalidColors); // => throws\n */\n nearestColor.from = function from(availableColors) {\n var colors = mapColors(availableColors),\n nearestColorBase = nearestColor;\n\n var matcher = function nearestColor(hex) {\n return nearestColorBase(hex, colors);\n };\n\n // Keep the 'from' method, to support changing the list of available colors\n // multiple times without needing to keep a reference to the original\n // nearestColor function.\n matcher.from = from;\n\n // Also provide a way to combine multiple color lists.\n matcher.or = function or(alternateColors) {\n var extendedColors = colors.concat(mapColors(alternateColors));\n return nearestColor.from(extendedColors);\n };\n\n return matcher;\n };\n\n /**\n * Given either an array or object of colors, returns an array of\n * {@link ColorSpec} objects (with {@link RGB} values).\n *\n * @private\n * @param {Array.<string>|Object} colors An array of hex-based color strings, or\n * an object mapping color *names* to hex values.\n * @return {Array.<ColorSpec>} An array of {@link ColorSpec} objects\n * representing the same colors passed in.\n */\n function mapColors(colors) {\n if (colors instanceof Array) {\n return colors.map(function(color) {\n return createColorSpec(color);\n });\n }\n\n return Object.keys(colors).map(function(name) {\n return createColorSpec(colors[name], name);\n });\n };\n\n /**\n * Parses a color from a string.\n *\n * @private\n * @param {RGB|string} source\n * @return {RGB}\n *\n * @example\n * parseColor({ r: 3, g: 22, b: 111 }); // => { r: 3, g: 22, b: 111 }\n * parseColor('#f00'); // => { r: 255, g: 0, b: 0 }\n * parseColor('#04fbc8'); // => { r: 4, g: 251, b: 200 }\n * parseColor('#FF0'); // => { r: 255, g: 255, b: 0 }\n * parseColor('rgb(3, 10, 100)'); // => { r: 3, g: 10, b: 100 }\n * parseColor('rgb(50%, 0%, 50%)'); // => { r: 128, g: 0, b: 128 }\n * parseColor('aqua'); // => { r: 0, g: 255, b: 255 }\n * parseColor('fff'); // => { r: 255, g: 255, b: 255 }\n * parseColor('foo'); // => throws\n */\n function parseColor(source) {\n var red, green, blue;\n\n if (typeof source === 'object') {\n return source;\n }\n\n if (source in nearestColor.STANDARD_COLORS) {\n return parseColor(nearestColor.STANDARD_COLORS[source]);\n }\n\n var hexMatch = source.match(/^#?((?:[0-9a-f]{3}){1,2})$/i);\n if (hexMatch) {\n hexMatch = hexMatch[1];\n\n if (hexMatch.length === 3) {\n hexMatch = [\n hexMatch.charAt(0) + hexMatch.charAt(0),\n hexMatch.charAt(1) + hexMatch.charAt(1),\n hexMatch.charAt(2) + hexMatch.charAt(2)\n ];\n\n } else {\n hexMatch = [\n hexMatch.substring(0, 2),\n hexMatch.substring(2, 4),\n hexMatch.substring(4, 6)\n ];\n }\n\n red = parseInt(hexMatch[0], 16);\n green = parseInt(hexMatch[1], 16);\n blue = parseInt(hexMatch[2], 16);\n\n return { r: red, g: green, b: blue };\n }\n\n var rgbMatch = source.match(/^rgb\\(\\s*(\\d{1,3}%?),\\s*(\\d{1,3}%?),\\s*(\\d{1,3}%?)\\s*\\)$/i);\n if (rgbMatch) {\n red = parseComponentValue(rgbMatch[1]);\n green = parseComponentValue(rgbMatch[2]);\n blue = parseComponentValue(rgbMatch[3]);\n\n return { r: red, g: green, b: blue };\n }\n\n throw Error('\"' + source + '\" is not a valid color');\n }\n\n /**\n * Creates a {@link ColorSpec} from either a string or an {@link RGB}.\n *\n * @private\n * @param {string|RGB} input\n * @param {string=} name\n * @return {ColorSpec}\n *\n * @example\n * createColorSpec('#800'); // => {\n * source: '#800',\n * rgb: { r: 136, g: 0, b: 0 }\n * }\n *\n * createColorSpec('#800', 'maroon'); // => {\n * name: 'maroon',\n * source: '#800',\n * rgb: { r: 136, g: 0, b: 0 }\n * }\n */\n function createColorSpec(input, name) {\n var color = {};\n\n if (name) {\n color.name = name;\n }\n\n if (typeof input === 'string') {\n color.source = input;\n color.rgb = parseColor(input);\n\n } else if (typeof input === 'object') {\n // This is for if/when we're concatenating lists of colors.\n if (input.source) {\n return createColorSpec(input.source, input.name);\n }\n\n color.rgb = input;\n color.source = rgbToHex(input);\n }\n\n return color;\n }\n\n /**\n * Parses a value between 0-255 from a string.\n *\n * @private\n * @param {string} string\n * @return {number}\n *\n * @example\n * parseComponentValue('100'); // => 100\n * parseComponentValue('100%'); // => 255\n * parseComponentValue('50%'); // => 128\n */\n function parseComponentValue(string) {\n if (string.charAt(string.length - 1) === '%') {\n return Math.round(parseInt(string, 10) * 255 / 100);\n }\n\n return Number(string);\n }\n\n /**\n * Converts an {@link RGB} color to its hex representation.\n *\n * @private\n * @param {RGB} rgb\n * @return {string}\n *\n * @example\n * rgbToHex({ r: 255, g: 128, b: 0 }); // => '#ff8000'\n */\n function rgbToHex(rgb) {\n return '#' + leadingZero(rgb.r.toString(16)) +\n leadingZero(rgb.g.toString(16)) + leadingZero(rgb.b.toString(16));\n }\n\n /**\n * Puts a 0 in front of a numeric string if it's only one digit. Otherwise\n * nothing (just returns the value passed in).\n *\n * @private\n * @param {string} value\n * @return\n *\n * @example\n * leadingZero('1'); // => '01'\n * leadingZero('12'); // => '12'\n */\n function leadingZero(value) {\n if (value.length === 1) {\n value = '0' + value;\n }\n return value;\n }\n\n /**\n * A map from the names of standard CSS colors to their hex values.\n */\n nearestColor.STANDARD_COLORS = {\n aqua: '#0ff',\n black: '#000',\n blue: '#00f',\n fuchsia: '#f0f',\n gray: '#808080',\n green: '#008000',\n lime: '#0f0',\n maroon: '#800000',\n navy: '#000080',\n olive: '#808000',\n orange: '#ffa500',\n purple: '#800080',\n red: '#f00',\n silver: '#c0c0c0',\n teal: '#008080',\n white: '#fff',\n yellow: '#ff0'\n };\n\n /**\n * Default colors. Comprises the colors of the rainbow (good ol' ROY G. BIV).\n * This list will be used for calls to {@nearestColor} that don't specify a list\n * of available colors to match.\n */\n nearestColor.DEFAULT_COLORS = mapColors([\n '#f00', // r\n '#f80', // o\n '#ff0', // y\n '#0f0', // g\n '#00f', // b\n '#008', // i\n '#808' // v\n ]);\n\n nearestColor.VERSION = '0.4.4';\n\n if (typeof module === 'object' && module && module.exports) {\n module.exports = nearestColor;\n } else {\n context.nearestColor = nearestColor;\n }\n\n}(this));\n","import { MoebiusHSLObjectType } from '../../types';\n\n/**\n * Represents an HSL (Hue, Saturation, Lightness) color unit.\n * @constructor\n * @param {MoebiusHSLObjectType} params - The HSL parameters.\n * @property {number} h - Hue component.\n * @property {number} s - Saturation component.\n * @property {number} l - Lightness component.\n */\nexport const UnitHSL = function (this: MoebiusHSLObjectType, [h, s, l]) {\n // Ensure the values are within valid ranges and convert them to numbers.\n this.h = Number(!isNaN(h) ? h.toFixed(0) : 0);\n this.s = Number((s * 100).toFixed());\n this.l = Number((l * 100).toFixed());\n};\n\n/**\n * Converts the HSL unit to a string representation.\n * @method\n * @returns {string} - The string representation of the HSL unit.\n * @example\n * ```ts\n * const hslUnit = new UnitHSL([30, 0.5, 0.8]);\n * const hslString = hslUnit.toString(); // \"hsl(30, 50%, 80%)\"\n * ```\n */\nUnitHSL.prototype.toString = function (): string {\n return `hsl(${Object.keys(this)\n .map((a, i) => `${this[a]}${i !== 0 ? '%' : ''}`)\n .join(', ')})`;\n};\n\n/**\n * Represents an HSL (Hue, Saturation, Lightness) color unit with floating-point values.\n * @constructor\n * @param {MoebiusHSLObjectType} params - The HSL parameters.\n * @property {number} h - Hue component.\n * @property {number} s - Saturation component.\n * @property {number} l - Lightness component.\n */\nexport const UnitHSLFloat = function (this: MoebiusHSLObjectType, [h, s, l]) {\n // Ensure the values are within valid ranges and convert them to numbers.\n this.h = Number(!isNaN(h) ? h.toFixed(0) : 0);\n this.s = Number(s.toFixed(2));\n this.l = Number(l.toFixed(2));\n};\n\n/**\n * Converts the HSL unit with floating-point values to a string representation.\n * @method\n * @returns {string} - The string representation of the HSL unit with floating-point values.\n * @example\n * ```ts\n * const hslFloatUnit = new UnitHSLFloat([30, 0.5, 0.8]);\n * const hslFloatString = hslFloatUnit.toString(); // \"30, 0.50, 0.80\"\n * ```\n */\nUnitHSLFloat.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusXYZObjectType } from '../../types';\n\n/**\n * Represents an XYZ color unit.\n * @constructor\n * @param {MoebiusXYZObjectType} params - The XYZ parameters.\n * @property {number} x - X component.\n * @property {number} y - Y component.\n * @property {number} z - Z component.\n */\nexport const UnitXYZ = function (this: MoebiusXYZObjectType, { x, y, z }) {\n this.x = x;\n this.y = y;\n this.z = z;\n};\n\n/**\n * Converts the XYZ unit to a string representation.\n * @method\n * @returns {string} - The string representation of the XYZ unit.\n * @example\n * ```ts\n * const xyzUnit = new UnitXYZ({ x: 0.4, y: 0.6, z: 0.8 });\n * const xyzString = xyzUnit.toString(); // \"0.4, 0.6, 0.8\"\n * ```\n */\nUnitXYZ.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusCMYKObjectType } from '../../types';\n\n/**\n * Represents a CMYK color unit.\n * @constructor\n * @param {MoebiusCMYKObjectType} params - The CMYK parameters.\n * @property {number} c - Cyan component.\n * @property {number} m - Magenta component.\n * @property {number} y - Yellow component.\n * @property {number} k - Black (Key) component.\n */\nexport const UnitCMYK = function (this: MoebiusCMYKObjectType, { c, m, y, k }) {\n this.c = c;\n this.m = m;\n this.y = y;\n this.k = k;\n};\n\n/**\n * Converts the CMYK unit to a string representation.\n * @method\n * @returns {string} - The string representation of the CMYK unit.\n * @example\n * ```ts\n * const cmykUnit = new UnitCMYK({ c: 0.2, m: 0.4, y: 0.6, k: 0.1 });\n * const cmykString = cmykUnit.toString(); // \"0.2, 0.4, 0.6, 0.1\"\n * ```\n */\nUnitCMYK.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusRGBObjectType } from '../../types';\n\n/**\n * Represents an RGB float color unit.\n * @constructor\n * @param {MoebiusRGBObjectType} params - The RGB float parameters.\n * @property {number} r - Red component.\n * @property {number} g - Green component.\n * @property {number} b - Blue component.\n */\nexport const UnitRGBFloat = function (this: MoebiusRGBObjectType, { r, g, b }) {\n this.r = r;\n this.g = g;\n this.b = b;\n};\n\n/**\n * Converts the RGB float unit to a string representation.\n * @method\n * @returns {string} - The string representation of the RGB float unit.\n * @example\n * ```ts\n * const rgbFloatUnit = new UnitRGBFloat({ r: 255, g: 128, b: 0 });\n * const rgbFloatString = rgbFloatUnit.toString(); // \"255, 128, 0\"\n * ```\n */\nUnitRGBFloat.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusHWBObjectType } from '../../types';\n\n/**\n * Represents an HWB (Hue, Whiteness, Blackness) color unit.\n * @constructor\n * @param {MoebiusHWBObjectType} params - The HWB parameters.\n * @property {number} h - Hue component.\n * @property {number} w - Whiteness component.\n * @property {number} b - Blackness component.\n */\nexport const UnitHWB = function (this: MoebiusHWBObjectType, { h, w, b }) {\n this.h = h;\n this.w = w;\n this.b = b;\n};\n\n/**\n * Converts the HWB unit to a string representation.\n * @method\n * @returns {string} - The string representation of the HWB unit.\n * @example\n * ```ts\n * const hwbUnit = new UnitHWB({ h: 200, w: 0.2, b: 0.1 });\n * const hwbString = hwbUnit.toString(); // \"200, 0.2, 0.1\"\n * ```\n */\nUnitHWB.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusLABObjectType } from '../../types';\n\n/**\n * Represents an LAB (CIELAB) color unit.\n * @constructor\n * @param {MoebiusLABObjectType} params - The LAB parameters.\n * @property {number} l - Lightness component.\n * @property {number} a - A color component.\n * @property {number} b - B color component.\n */\nexport const UnitLAB = function (this: MoebiusLABObjectType, [l, a, b]) {\n this.l = Number(l.toFixed(2));\n this.a = Number(a.toFixed(2));\n this.b = Number(b.toFixed(2));\n};\n\n/**\n * Converts the LAB unit to a string representation.\n * @method\n * @returns {string} - The string representation of the LAB unit.\n * @example\n * ```ts\n * const labUnit = new UnitLAB([70, 10, 20]);\n * const labString = labUnit.toString(); // \"70, 10, 20\"\n * ```\n */\nUnitLAB.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusLABObjectType } from '../../types';\n\n/**\n * Represents an OKLAB color unit.\n * @constructor\n * @param {MoebiusLABObjectType} params - The OKLAB parameters.\n * @property {number} l - Lightness component.\n * @property {number} a - First color opponent axis.\n * @property {number} b - Second color opponent axis.\n */\nexport const UnitOKLAB = function (this: MoebiusLABObjectType, [l, a, b]) {\n this.l = Number(l.toFixed(2));\n this.a = Number(a.toFixed(2));\n this.b = Number(b.toFixed(2));\n};\n\n/**\n * Converts the OKLAB unit to a string representation.\n * @method\n * @returns {string} - The string representation of the OKLAB unit.\n * @example\n * ```ts\n * const oklabUnit = new UnitOKLAB([70, 30, 45]);\n * const oklabString = oklabUnit.toString(); // \"70, 30, 45\"\n * ```\n */\nUnitOKLAB.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusHSVObjectType } from '../../types';\n\n/**\n * Represents an HSV (Hue, Saturation, Value) color unit.\n * @constructor\n * @param {MoebiusHSVObjectType} params - The HSV parameters.\n * @property {number} h - Hue component.\n * @property {number} s - Saturation component.\n * @property {number} v - Value component.\n */\nexport const UnitHSV = function (this: MoebiusHSVObjectType, [h, s, v]) {\n // Ensure the values are within valid ranges and convert them to numbers.\n this.h = Number(!isNaN(h) ? h.toFixed(2) : 0);\n this.s = Number(s.toFixed(2));\n this.v = Number(v.toFixed(2));\n};\n\n/**\n * Converts the HSV unit to a string representation.\n * @method\n * @returns {string} - The string representation of the HSV unit.\n * @example\n * ```ts\n * const hsvUnit = new UnitHSV([30, 0.5, 0.8]);\n * const hsvString = hsvUnit.toString(); // \"30, 0.50, 0.80\"\n * ```\n */\nUnitHSV.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusLCHObjectType } from '../../types';\n\n/**\n * Represents an LCH (CIELCH) color unit.\n * @constructor\n * @param {MoebiusLCHObjectType} params - The LCH parameters.\n * @property {number} l - Lightness component.\n * @property {number} c - Chroma component.\n * @property {number} h - Hue component.\n */\nexport const UnitLCH = function (this: MoebiusLCHObjectType, [l, c, h]) {\n this.l = Number(l.toFixed(2));\n this.c = Number(c.toFixed(2));\n this.h = Number(!isNaN(h) ? h.toFixed(2) : 0);\n};\n\n/**\n * Converts the LCH unit to a string representation.\n * @method\n * @returns {string} - The string representation of the LCH unit.\n * @example\n * ```ts\n * const lchUnit = new UnitLCH([70, 30, 45]);\n * const lchString = lchUnit.toString(); // \"70, 30, 45\"\n * ```\n */\nUnitLCH.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusLCHObjectType } from '../../types';\n\n/**\n * Represents an OKLCH color unit.\n * @constructor\n * @param {MoebiusLCHObjectType} params - The OKLCH parameters.\n * @property {number} l - Lightness component.\n * @property {number} c - Chroma component.\n * @property {number} h - Hue component.\n */\nexport const UnitOKLCH = function (this: MoebiusLCHObjectType, [l, c, h]) {\n this.l = Number(l.toFixed(2));\n this.c = Number(c.toFixed(2));\n this.h = Number(!isNaN(h) ? h.toFixed(2) : 0);\n};\n\n/**\n * Converts the OKLCH unit to a string representation.\n * @method\n * @returns {string} - The string representation of the OKLCH unit.\n * @example\n * ```ts\n * const oklchUnit = new UnitOKLCH([70, 30, 45]);\n * const oklchString = oklchUnit.toString(); // \"70, 30, 45\"\n * ```\n */\nUnitOKLCH.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import { MoebiusHSIObjectType } from '../../types';\n\n/**\n * Represents an HSI (Hue, Saturation, Intensity) color unit.\n * @constructor\n * @param {MoebiusHSIObjectType} params - The HSI parameters.\n * @property {number} h - Hue component.\n * @property {number} s - Saturation component.\n * @property {number} i - Intensity component.\n */\nexport const UnitHSI = function (this: MoebiusHSIObjectType, [h, s, i]) {\n // Ensure the values are within valid ranges and convert them to numbers.\n this.h = Number(!isNaN(h) ? h.toFixed(2) : 0);\n this.s = Number(s.toFixed(2));\n this.i = Number(i.toFixed(2));\n};\n\n/**\n * Converts the HSI unit to a string representation.\n * @method\n * @returns {string} - The string representation of the HSI unit.\n * @example\n * ```ts\n * const hsiUnit = new UnitHSI([30, 0.5, 0.8]);\n * const hsiString = hsiUnit.toString(); // \"30, 0.5, 0.8\"\n * ```\n */\nUnitHSI.prototype.toString = function (): string {\n return Object.keys(this)\n .map((a) => `${this[a]}`)\n .join(', ');\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusHSLObjectType,\n MoebiusRGBObjectType\n} from '../../types';\nimport { UnitHSLFloat } from '../color-objects/hsl';\nimport { UnitRGBFloat } from '../color-objects/rgb';\n\n/**\n * Converts a color to its float representation.\n * @param {MoebiusChromaColorInputType} color - The input color in hex, rgb, or rgba format.\n * @param {string} [type] - The color type ('hsl' for HSL, undefined for RGB).\n * @returns {UnitHSLFloat | UnitRGBFloat} - The float representation of the color.\n * @example\n * ```ts\n * const hslFloatColor = toFloat('#00ff00', 'hsl');\n * console.log(hslFloatColor.toString()); // 120, 100, 50\n * ```\n * @example\n * ```ts\n * const rgbFloatColor = toFloat('#00ff00');\n * console.log(rgbFloatColor.toString()); // 0, 1, 0\n * ```\n */\nexport const toFloat = (\n color: MoebiusChromaColorInputType,\n type?: string\n): MoebiusHSLObjectType | MoebiusRGBObjectType => {\n if (type === 'hsl') {\n // Convert the color to HSL and create a new HSL float unit\n return new UnitHSLFloat(chroma(color).hsl());\n }\n\n // Convert the color to RGB and create a new RGB float unit\n const _rgb = chroma(color).rgb();\n const rgbFloat = new UnitRGBFloat({\n r: Number((_rgb[0] / 255).toFixed(2)),\n g: Number((_rgb[1] / 255).toFixed(2)),\n b: Number((_rgb[2] / 255).toFixed(2))\n });\n\n return rgbFloat;\n};\n","/**\n * Normalizes an RGB input value.\n * @param {number} r - The input value in the RGB color space (0 to 255).\n * @returns {number} - The normalized value.\n */\nexport const normalizeRGBInput = (r: number) => {\n if ((r /= 255) <= 0.04045) return r / 12.92;\n\n return Math.pow((r + 0.055) / 1.055, 2.4);\n};\n\n/**\n * Normalizes a LAB input value.\n * @param {number} t - The input value in the LAB color space.\n * @returns {number} - The normalized value.\n */\nexport const normalizeLABInput = (t: number) => {\n if (t > 0.008856452) return Math.pow(t, 1 / 3);\n\n return t / 0.12841855 + 0.137931034;\n};\n","import {\n MoebiusCMYKObjectType,\n MoebiusColorValueHexType,\n MoebiusColorValueRgbType,\n MoebiusHSIObjectType,\n MoebiusHSLObjectType,\n MoebiusHSVObjectType,\n MoebiusHWBObjectType,\n MoebiusLABObjectType,\n MoebiusLCHObjectType,\n MoebiusColorInterface,\n MoebiusRGBObjectType,\n MoebiusXYZObjectType,\n MoebiusChromaColorInputType\n} from '../types';\nimport * as CONVERTERS from '../utils/converters';\n\n/**\n * MoebiusColor class representing a color with various formats and conversions.\n * @class\n * @example\n * ```ts\n * const mColor = new MoebiusColor('#ff9900')\n * ```\n */\nexport class MoebiusColor implements MoebiusColorInterface {\n color: MoebiusChromaColorInputType;\n name: string;\n hex: MoebiusColorValueHexType;\n rgb: MoebiusColorValueRgbType;\n hsl: MoebiusHSLObjectType;\n hwb: MoebiusHWBObjectType;\n hsv: MoebiusHSVObjectType;\n lab: MoebiusLABObjectType;\n xyz: MoebiusXYZObjectType;\n lch: MoebiusLCHObjectType;\n oklch: MoebiusLCHObjectType;\n hsi: MoebiusHSIObjectType;\n oklab: MoebiusLABObjectType;\n cmyk: MoebiusCMYKObjectType;\n rgbFloat: MoebiusRGBObjectType;\n hslFloat: MoebiusHSLObjectType;\n\n /**\n * Creates an instance of MoebiusColor.\n * @param {MoebiusChromaColorInputType} value - The hex value of the color.\n * @param {string} name - The name of the color\n * @constructor\n * @throws Will throw an error if init has not been run before creating an instance.\n */\n constructor(color: MoebiusChromaColorInputType, name: string) {\n this.color = color;\n this.name = name;\n\n this.hex = CONVERTERS.toHEX(this.color);\n this.cmyk = CONVERTERS.toCMYK(this.color);\n this.xyz = CONVERTERS.toXYZ(this.color);\n this.hsl = CONVERTERS.toHSL(this.color);\n this.hwb = CONVERTERS.toHWB(this.color);\n this.lab = CONVERTERS.toLAB(this.color);\n this.oklab = CONVERTERS.toOKLAB(this.color);\n this.hsv = CONVERTERS.toHSV(this.color);\n this.lch = CONVERTERS.toLCH(this.color);\n this.oklch = CONVERTERS.toOKLCH(this.color);\n this.hsi = CONVERTERS.toHSI(this.color);\n this.rgb = CONVERTERS.toRGB(this.color);\n this.rgbFloat = CONVERTERS.toFloat(this.color) as MoebiusRGBObjectType;\n this.hslFloat = CONVERTERS.toFloat(\n this.color,\n 'hsl'\n ) as MoebiusHSLObjectType;\n }\n /**\n * Converts the color to an object in the specified color space.\n * @param {string} type - The color space type (e.g., 'rgb' or 'hsl').\n * @returns {MoebiusRGBObjectType | MoebiusHSLObjectType} The color object in the specified color space.\n */\n toObject(type?: string): MoebiusRGBObjectType | MoebiusHSLObjectType {\n return CONVERTERS.toObject(this.color, type);\n }\n /**\n * Converts the color to a floating-point representation in the specified color space.\n * @param {string} type - The color space type (e.g., 'rgb' or 'hsl').\n * @returns {MoebiusRGBObjectType | MoebiusHSLObjectType} The floating-point representation of the color in the specified color space.\n */\n toFloat(type?: string): MoebiusRGBObjectType | MoebiusHSLObjectType {\n return CONVERTERS.toFloat(this.color, type);\n }\n}\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType\n} from '../../types';\n\n/**\n * Converts a color to its corresponding HEX representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in various formats (HEX, RGB, HSL, etc.).\n * @returns {MoebiusColorValueHexType} The HEX representation of the color.\n *\n * @example\n * ```ts\n * const hexColor = toHEX('#3498db');\n * console.log(hexColor); // Output: '#3498db'\n * ```\n */\nexport const toHEX = (\n color: MoebiusChromaColorInputType\n): MoebiusColorValueHexType => {\n return chroma(color).hex();\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusCMYKObjectType,\n MoebiusChromaColorInputType\n} from '../../types';\nimport { UnitCMYK } from '../color-objects';\n\n/**\n * Converts an RGB color to its CMYK representation.\n * @param {MoebiusChromaColorInputType} color - The input color in hex, rgb, or rgba format.\n * @returns {MoebiusCMYKObjectType} - The CMYK representation of the color.\n * @example\n * ```ts\n * const cmykColor = toCMYK('#00ff00');\n * console.log(cmykColor); // { c: 40, m: 0, y: 100, k: 0 }\n * ```\n */\nexport const toCMYK = (\n color: MoebiusChromaColorInputType\n): MoebiusCMYKObjectType => {\n // Convert the color to RGB components\n let [r, b, g] = chroma(color).rgb();\n\n // Normalize RGB values to the range [0, 1]\n r /= 255;\n g /= 255;\n b /= 255;\n\n // Calculate the CMYK components\n const k = +(1 - Math.max(r, g, b));\n const c = +((1 - r - k) / (1 - k) || 0);\n const m = +((1 - g - k) / (1 - k) || 0);\n const y = +((1 - b - k) / (1 - k) || 0);\n\n // Create a new CMYK unit\n return new UnitCMYK({\n c: Number((c * 100).toFixed()),\n m: Number((m * 100).toFixed()),\n y: Number((y * 100).toFixed()),\n k: Number((k * 100).toFixed())\n });\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusXYZObjectType } from '../../types';\nimport { UnitXYZ } from '../color-objects';\nimport { normalizeLABInput, normalizeRGBInput } from '../normalize-color-units';\n\n/**\n * Converts a color from RGB to CIE 1931 XYZ color space.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hexadecimal format.\n * @returns {MoebiusXYZObjectType} - An object representing the XYZ color values.\n */\nexport const toXYZ = (\n color: MoebiusChromaColorInputType\n): MoebiusXYZObjectType => {\n // Extract RGB components from the input color\n let [r, b, g] = chroma(color).rgb();\n\n // Normalize RGB values\n r = normalizeRGBInput(r);\n g = normalizeRGBInput(g);\n b = normalizeRGBInput(b);\n\n // Convert RGB to XYZ\n const x = normalizeLABInput(\n (0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / 0.95047\n );\n const y = normalizeLABInput(\n (0.2126729 * r + 0.7151522 * g + 0.072175 * b) / 1\n );\n const z = normalizeLABInput(\n (0.0193339 * r + 0.119192 * g + 0.9503041 * b) / 1.08883\n );\n\n // Return XYZ color values as a UnitXYZ object\n return new UnitXYZ({\n x: Number(x.toFixed(2)),\n y: Number(y.toFixed(2)),\n z: Number(z.toFixed(2))\n });\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusHSLObjectType } from '../../types';\nimport { UnitHSL } from '../color-objects';\n\n/**\n * Converts a color to its corresponding HSL object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusHSLObjectType} The HSL color representation object.\n *\n * @example\n * ```ts\n * const hslObject = toHSL('#3498db');\n * console.log(hslObject); // Output: { h: 207.76, s: 0.86, l: 0.56 }\n * ```\n */\nexport const toHSL = (\n color: MoebiusChromaColorInputType\n): MoebiusHSLObjectType => {\n return new UnitHSL(chroma(color).hsl());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusHWBObjectType } from '../../types';\nimport { UnitHWB } from '../color-objects';\n\n/**\n * Converts a color to its corresponding HWB object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusHWBObjectType} The HWB color representation object.\n *\n * @example\n * ```ts\n * const hwbObject = toHWB('#3498db');\n * console.log(hwbObject); // Output: { h: 207.76, w: 0.5, b: 0.14 }\n * ```\n */\nexport const toHWB = (\n color: MoebiusChromaColorInputType\n): MoebiusHWBObjectType => {\n let [r, b, g] = chroma(color).rgb();\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n const w = Math.min(r, g, b);\n const v = Math.max(r, g, b);\n const black = 1 - v;\n\n if (v === w) return { h: 0, w: w, b: black };\n\n const f = r === w ? g - b : g === w ? b - r : r - g;\n const i = r === w ? 3 : g === w ? 5 : 1;\n\n return new UnitHWB({\n h: Number(((i - f / (v - w)) / 6).toFixed(2)),\n w: Number(w.toFixed(2)),\n b: Number(black.toFixed(2))\n });\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusLABObjectType } from '../../types';\nimport { UnitLAB } from '../color-objects';\n\n/**\n * Converts a color to its corresponding LAB object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusLABObjectType} The LAB color representation object.\n *\n * @example\n * ```ts\n * const labObject = toLAB('#3498db');\n * console.log(labObject); // Output: { l: 54.24, a: -12.56, b: -43.81 }\n * ```\n */\nexport const toLAB = (\n color: MoebiusChromaColorInputType\n): MoebiusLABObjectType => {\n return new UnitLAB(chroma(color).lab());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusLABObjectType } from '../../types';\nimport { UnitOKLAB } from '../color-objects';\n\n/**\n * Converts a color to its OKLAB representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusLABObjectType} The OKLAB representation of the input color.\n *\n * @example\n * ```ts\n * const oklabColor = toOKLAB('#3498db');\n * console.log(oklabColor); // Output: { l: 52.42, a: -9.93, b: -39.49 }\n * ```\n */\nexport const toOKLAB = (\n color: MoebiusChromaColorInputType\n): MoebiusLABObjectType => {\n return new UnitOKLAB(chroma(color).oklab());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusHSVObjectType } from '../../types';\nimport { UnitHSV } from '../color-objects';\n\n/**\n * Converts a color to its corresponding HSV object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusHSVObjectType} The HSV color representation object.\n *\n * @example\n * ```ts\n * const hsvObject = toHSV('#3498db');\n * console.log(hsvObject); // Output: { h: 207.76, s: 0.86, v: 0.85 }\n * ```\n */\nexport const toHSV = (\n color: MoebiusChromaColorInputType\n): MoebiusHSVObjectType => {\n return new UnitHSV(chroma(color).hsv());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusLCHObjectType } from '../../types';\nimport { UnitLCH } from '../color-objects';\n\n/**\n * Converts a color to its corresponding LCH object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusLCHObjectType} The LCH color representation object.\n *\n * @example\n * ```ts\n * const lchObject = toLCH('#3498db');\n * console.log(lchObject); // Output: { l: 54.66, c: 76.91, h: 217.76 }\n * ```\n */\nexport const toLCH = (\n color: MoebiusChromaColorInputType\n): MoebiusLCHObjectType => {\n return new UnitLCH(chroma(color).lch());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusLCHObjectType } from '../../types';\nimport { UnitOKLCH } from '../color-objects';\n\n/**\n * Converts a color to its OKLCH representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusLCHObjectType} The OKLCH representation of the input color.\n *\n * @example\n * ```ts\n * const oklchColor = toOKLCH('#3498db');\n * console.log(oklchColor); // Output: { l: 52.12, c: 126.62, h: 232.53 }\n * ```\n */\nexport const toOKLCH = (\n color: MoebiusChromaColorInputType\n): MoebiusLCHObjectType => {\n return new UnitOKLCH(chroma(color).oklch());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusHSIObjectType } from '../../types';\nimport { UnitHSI } from '../color-objects';\n\n/**\n * Converts a color to its corresponding HSI object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusHSIObjectType} The HSI color representation object.\n *\n * @example\n * ```ts\n * const hsiObject = toHSI('#3498db');\n * console.log(hsiObject); // Output: { h: 207.76, s: 0.52, i: 0.4 }\n * ```\n */\nexport const toHSI = (\n color: MoebiusChromaColorInputType\n): MoebiusHSIObjectType => {\n return new UnitHSI(chroma(color).hsi());\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueRgbType\n} from '../../types';\n\n/**\n * Converts a color to its RGB representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in any valid chroma-js format.\n * @returns {MoebiusColorValueRgbType} The RGB representation of the input color.\n *\n * @example\n * ```ts\n * const rgbColor = toRGB('#3498db');\n * console.log(rgbColor); // Output: 'rgb(52, 152, 219)'\n * ```\n */\nexport const toRGB = (\n color: MoebiusChromaColorInputType\n): MoebiusColorValueRgbType => {\n const [r, g, b] = chroma(color).rgb();\n\n return `rgb(${r}, ${g}, ${b})`;\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusHSLObjectType,\n MoebiusRGBObjectType\n} from '../../types';\n\n/**\n * Converts a color to its corresponding object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @param {string} [type] - The type of representation ('hsl' or undefined for RGB).\n * @returns {MoebiusRGBObjectType | MoebiusHSLObjectType} The color representation object.\n *\n * @example\n * ```ts\n * const rgbObject = toObject('#3498db');\n * console.log(rgbObject); // Output: { r: 52, g: 152, b: 219 }\n *\n * const hslObject = toObject('#3498db', 'hsl');\n * console.log(hslObject); // Output: { h: 207, s: 79, l: 57 }\n * ```\n */\nexport const toObject = (\n color: MoebiusChromaColorInputType,\n type?: string\n): MoebiusRGBObjectType | MoebiusHSLObjectType => {\n if (type === 'hsl') {\n const [h, s, l] = chroma(color).hsl();\n\n return {\n h: Number(!isNaN(h) ? h.toFixed(0) : 0),\n s: Number((s * 100).toFixed()),\n l: Number((l * 100).toFixed())\n };\n }\n\n const rgb = chroma(color).rgb();\n const rgbObject = {\n r: rgb[0],\n g: rgb[1],\n b: rgb[2]\n };\n\n return rgbObject;\n};\n","import { MoebiusPaletteDefaultOptionsType } from '../types';\n\n/**\n * Default options for the Moebius Palette.\n *\n * @type {MoebiusPaletteDefaultOptionsType}\n * @readonly\n *\n * @example\n * ```ts\n * console.log(MOEBIUS_PALETTE_DEFAULT_OPTIONS);\n * // {\n * // diverging: false,\n * // bezier: false,\n * // randomOffset: false,\n * // correctLightness: false,\n * // noDuplicates: true,\n * // colorScaleMode: 'lch',\n * // reverseDirection: false\n * // }\n * ```\n */\nexport const MOEBIUS_PALETTE_DEFAULT_OPTIONS: MoebiusPaletteDefaultOptionsType =\n {\n diverging: false,\n bezier: false,\n randomOffset: false,\n correctLightness: false,\n noDuplicates: true,\n colorScaleMode: 'lch',\n reverseDirection: false\n };\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\n/**\n * Generate a harmonized color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the harmonized palette.\n * @param {number} start - The starting angle for generating harmonized colors (degrees).\n * @param {number} end - The ending angle for generating harmonized colors (degrees).\n * @param {number} interval - The interval between harmonized colors (degrees).\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {boolean} [options.noDuplicates=true] - Whether to remove duplicate colors in the palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the harmonized palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const harmonizedPalette = harmonize(baseColor, 30, 210, 30, { noDuplicates: true });\n * console.log(harmonizedPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#3498db']\n * ```\n */\nexport const harmonize = (\n color: MoebiusChromaColorInputType,\n start: number,\n end: number,\n interval: number,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const { noDuplicates = true } = options;\n // Initialize the array with the base color.\n const colors = [chroma(color).hex()];\n\n // Convert the HSL color to an object for easy manipulation.\n let [h, s, l] = chroma(color).hsl();\n\n if (isNaN(h)) {\n h = 0;\n }\n\n s = Number((s * 100).toFixed());\n l = Number((l * 100).toFixed());\n\n // Generate harmonized colors within the specified range.\n for (let i = start; i <= end; i += interval) {\n // Calculate the adjusted hue.\n const h1 = Number(((h + i) % 360).toFixed());\n\n // Create the harmonized color in HSL format and add it to the array.\n colors.push(chroma(`hsl(${h1}, ${s}%, ${l}%)`).hex());\n }\n\n let uniqueColors = colors;\n\n if (noDuplicates) {\n uniqueColors = [...new Set(colors)];\n }\n\n return uniqueColors;\n};\n","/**\n * Generates a random integer within a specified range.\n *\n * @param {number} max - The maximum value (inclusive) for the random number.\n * @param {number} min - The minimum value (inclusive) for the random number.\n * @returns {number} - A random integer within the specified range.\n *\n * @example\n * ```ts\n * // Generate a random integer between 1 and 10, inclusive\n * const randomNumber = random(10, 1);\n * console.log(randomNumber); // Example output: 5\n * ```\n */\nexport const random = (max: number, min: number): number =>\n Math.floor(Math.random() * (max - min + 1)) + min;\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusColorValueHslType,\n MoebiusPaletteOptionsType\n} from '../types';\nimport { random } from '../utils/random';\n\n/**\n * Generates a monochromatic color palette based on the given color.\n * @param {MoebiusChromaColorInputType} color - The base color for the palette.\n * @param {MoebiusPaletteOptionsType} options - Options for generating the palette.\n * @returns {MoebiusColorValueHexType[]} - An array of hex color values in the palette.\n * @example\n * ```typescript\n * const baseColor = '#003f5c';\n * const options = { numberOfColors: 5, bezier: true, randomOffset: false };\n * const monochromaticPalette = monochromatic(baseColor, options);\n * console.log(monochromaticPalette);\n * [\n * '#003f5c', // maniacMansion,\n * '#014268', // darkImperialBlue,\n * '#024575', // macraggeBlue,\n * '#044784', // bridgeport,\n * '#064898', // frightNight,\n * '#0745b6', // absoluteZero,\n * '#002df5', // blueBouquet\n * ];\n * ```\n */\nexport const monochromatic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n bezier = false,\n randomOffset = false,\n colorScaleMode,\n noDuplicates = true,\n reverseDirection = false,\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n let [h, s, l] = chroma(color).hsl();\n\n if (isNaN(h)) {\n h = 0;\n }\n\n h = Number(h.toFixed(0));\n s = Number((s * 100).toFixed(0));\n l = Number((l * 100).toFixed(0));\n\n const hslColors: MoebiusColorValueHslType[] = [];\n\n hslColors.push(chroma(`hsl(${h}, ${s}%, ${l < 0 ? 0 : l}%)`).hex());\n\n if (randomOffset) {\n // because we've already added the original color, we start counting from 1\n for (let i = 1; i < numberOfColors; i++) {\n if (reverseDirection) {\n l += random(0, 10);\n h += random(-5, 5);\n } else {\n l -= random(0, 10);\n h -= random(-5, 5);\n }\n\n if (h > 359) h = 359;\n\n if (h < 0) h = 0;\n\n hslColors.push(chroma(`hsl(${h}, ${s}%, ${l < 0 ? 0 : l}%)`).hex());\n }\n } else {\n for (let i = 1; i < numberOfColors; i++) {\n if (reverseDirection) {\n l += 5;\n h += 5;\n } else {\n l -= 5;\n h -= 5;\n }\n\n if (h > 359) h = 359;\n\n if (h < 0) h = 0;\n\n hslColors.push(chroma(`hsl(${h}, ${s}%, ${l < 0 ? 0 : l}%)`).hex());\n }\n }\n\n let colors = hslColors.map((color) => chroma(color).hex());\n\n if (noDuplicates) {\n colors = [...new Set(colors)];\n }\n\n if (bezier) {\n if (colors.length > 1) {\n colors = chroma\n .bezier(colors)\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n } else {\n colors = chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n }\n }\n\n return colors;\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType,\n MoebiusChromaColorInputType\n} from '../types';\nimport { range } from '../utils/range';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a luminance shift palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the luminance shift palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {boolean} [options.diverging=false] - Whether to generate a diverging palette.\n * @param {number} [options.numberOfColors=7] - The number of colors in the luminance shift palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the luminance shift palette.\n * @private\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const luminanceShiftPalette = generateLuminanceShiftPalette(baseColor, { numberOfColors: 5 });\n * console.log(luminanceShiftPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\nconst generateLuminanceShiftPalette = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n) => {\n if (!color) throw new Error('MoebiusPalettes: missing input `color`');\n\n const { diverging = false, numberOfColors = 7 } =\n options as MoebiusPaletteOptionsType;\n const [l, a, b] = chroma(color).lab();\n const lRange = 100 * (0.95 - 1 / numberOfColors);\n const lStep = lRange / (numberOfColors - 1);\n const lStart = (100 - lRange) * 0.5;\n const colorRange = range(lStart, lStart + numberOfColors * lStep, lStep);\n\n let offset = 0;\n\n if (!diverging) {\n offset = 9999;\n for (let i = 0; i < numberOfColors; i++) {\n const diff = l - colorRange[i];\n\n if (Math.abs(diff) < Math.abs(offset)) {\n offset = diff;\n }\n }\n }\n\n return colorRange.map((l) => chroma.lab([l + offset, a, b]).hex());\n};\n/**\n * Generate an array of auto colors for luminance shift based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating auto colors.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the auto colors.\n * @param {number} [options.numberOfColors] - The number of auto colors to generate.\n * @param {boolean} [options.reverseDirection=false] - Whether to reverse the order of generated colors.\n * @param {boolean} [options.diverging=false] - Whether to generate diverging auto colors.\n * @param {string} [options.divergentColor] - The divergent color to include in the palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the auto colors.\n * @private\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const autoColors = luminanceShiftAutoColors(baseColor, { numberOfColors: 5 });\n * console.log(autoColors); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\nconst luminanceShiftAutoColors = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n) => {\n const {\n numberOfColors,\n reverseDirection = false,\n diverging = false,\n divergentColor\n } = options;\n\n if (diverging) {\n const colors = generateLuminanceShiftPalette(chroma(color).hex(), {\n numberOfColors: Math.ceil((numberOfColors as number) / 2)\n }).concat(divergentColor);\n\n if (reverseDirection) colors.reverse();\n\n return colors;\n } else {\n return generateLuminanceShiftPalette(color, { numberOfColors });\n }\n};\n\n/**\n * Generate a luminance shift palette based on an array of colors, with optional diverging colors.\n *\n * @param {MoebiusChromaColorInputType[]} colors - Array of base colors for generating the luminance shift palette.\n * @param {MoebiusChromaColorInputType[]} [divergingColors=[]] - Array of diverging colors.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The total number of colors in the luminance shift palette.\n * @param {boolean} [options.diverging=false] - Whether to generate a diverging palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation.\n * @param {string} [options.divergentColor='#f5f5f5'] - The divergent color for a diverging palette.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the luminance shift palette.\n *\n * @example\n * ```ts\n * const baseColors = ['#3498db', '#99db34'];\n * const divergingColors = ['#db3434'];\n * const luminanceShiftPalette = luminanceShift(baseColors, divergingColors, { numberOfColors: 5 });\n * console.log(luminanceShiftPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\nexport const luminanceShift = (\n colors: MoebiusChromaColorInputType[],\n divergingColors: MoebiusChromaColorInputType[] = [],\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n diverging = false,\n colorScaleMode,\n bezier = false,\n divergentColor = '#f5f5f5',\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n divergingColors =\n divergingColors.length === 0\n ? [harmonize(colors[0], 90, 270, 90)[3]]\n : divergingColors;\n\n const even = numberOfColors % 2 === 0;\n const numberOfColorsLeft = diverging\n ? Math.ceil(numberOfColors / 2) + (even ? 1 : 0)\n : numberOfColors;\n const numberOfColorsRight = diverging\n ? Math.ceil(numberOfColors / 2) + (even ? 1 : 0)\n : 0;\n const generatedColors =\n colors.length !== 1\n ? colors\n : luminanceShiftAutoColors(colors[0], {\n numberOfColors: numberOfColorsLeft,\n divergentColor\n });\n\n let generatedDivergentColors: string[] = [];\n\n if (diverging) {\n generatedDivergentColors =\n divergingColors.length !== 1\n ? divergingColors\n : luminanceShiftAutoColors(divergingColors[0], {\n numberOfColors: numberOfColorsRight,\n divergentColor,\n reverse: false,\n diverging\n });\n }\n\n let stepsLeft = colors.length\n ? chroma\n .scale(generatedColors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColorsLeft)\n : [];\n\n if (bezier) {\n stepsLeft = colors.length\n ? chroma\n .bezier(generatedColors)\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColorsLeft)\n : [];\n }\n\n let stepsRight =\n diverging && divergingColors.length\n ? chroma\n .scale(generatedDivergentColors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColorsRight)\n : [];\n\n if (bezier) {\n stepsRight =\n diverging && divergingColors.length\n ? chroma\n .bezier(generatedDivergentColors)\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColorsRight)\n : [];\n }\n\n let steps = stepsLeft;\n\n steps = (\n diverging\n ? stepsLeft.slice(\n 0,\n stepsLeft.length - (numberOfColorsLeft % 2 !== 0 ? 0 : 1)\n )\n : stepsLeft\n )\n //).concat(stepsRight.slice(1).reverse());\n .concat(stepsRight.reverse());\n\n return steps;\n};\n","/**\n * Generates an array of numbers within a specified range with a given interval.\n * @param {number} start - The starting value of the range.\n * @param {number} stop - The stopping value of the range.\n * @param {number} interval - The interval between numbers in the range.\n * @returns {number[]} - An array of numbers in the specified range.\n * @example\n * ```ts\n * const result = range(1, 10, 2);\n * console.log(result); // [1, 3, 5, 7, 9]\n * ```\n */\nexport const range = (\n start: number,\n stop: number,\n interval: number\n): number[] => {\n const a: number[] = [];\n\n for (let i = start; i < stop; i += interval) {\n a.push(i);\n }\n\n return a;\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusColorValueHexType, MoebiusPaletteOptionsType } from '../types';\n\n/**\n * Generates a color scale using Chroma.js's bezier interpolation.\n * @param {MoebiusColorValueHexType[]} colors - The input colors for the bezier interpolation.\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} [options={}] - Options for generating the color scale.\n * @param {number} [options.numberOfColors=8] - The number of colors in the resulting scale.\n * @param {string} [options.colorScaleMode] - The color scale mode for Chroma.js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the color scale.\n * @returns {MoebiusColorValueHexType[]} - The generated color scale.\n * @example\n * ```ts\n * const inputColors = ['#3498db', '#2ecc71', '#e74c3c'];\n * const options = { numberOfColors: 5, colorScaleMode: 'lch', correctLightness: false };\n * const scaleColors = getChromaBezierScaleColors(inputColors, options);\n * console.log(scaleColors);\n * ```\n */\nexport const getChromaBezierScaleColors = (\n colors: MoebiusColorValueHexType[],\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n) => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n try {\n return chroma\n .bezier(colors)\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n } catch {\n return [];\n }\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusColorValueHexType, MoebiusPaletteOptionsType } from '../types';\n\n/**\n * Generates a color scale using Chroma.js.\n * @param {MoebiusColorValueHexType[]} colors - The input colors for the color scale.\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} [options={}] - Options for generating the color scale.\n * @param {number} [options.numberOfColors=8] - The number of colors in the resulting scale.\n * @param {string} [options.colorScaleMode] - The color scale mode for Chroma.js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the color scale.\n * @returns {MoebiusColorValueHexType[]} - The generated color scale.\n * @example\n * ```ts\n * const inputColors = ['#3498db', '#2ecc71', '#e74c3c'];\n * const options = { numberOfColors: 5, colorScaleMode: 'lch', correctLightness: false };\n * const scaleColors = getChromaScaleColors(inputColors, options);\n * console.log(scaleColors);\n * ```\n */\nexport const getChromaScaleColors = (\n colors: MoebiusColorValueHexType[],\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n) => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n try {\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n } catch {\n return [];\n }\n};\n","import { monochromatic } from '../features';\nimport {\n MoebiusColorValueHexType,\n MoebiusPaletteAccentColorsInterface,\n MoebiusPaletteColorsInterface,\n MoebiusPaletteOptionsType\n} from '../types';\n\n/**\n * Class representing a set of accent colors in various palettes.\n */\nexport class MoebiusAccentColors\nimplements MoebiusPaletteAccentColorsInterface\n{\n interpolate: MoebiusColorValueHexType[][];\n luminanceShift: MoebiusColorValueHexType[][];\n monochromatic: MoebiusColorValueHexType[][];\n complement: MoebiusColorValueHexType[][];\n split: MoebiusColorValueHexType[][];\n triadic: MoebiusColorValueHexType[][];\n tetradic: MoebiusColorValueHexType[][];\n pentadic: MoebiusColorValueHexType[][];\n hexadic: MoebiusColorValueHexType[][];\n analogous: MoebiusColorValueHexType[][];\n\n /**\n * Creates an instance of MoebiusAccentColors.\n * @param {MoebiusPaletteColorsInterface} colors - Base colors for accent palettes.\n * @param {MoebiusPaletteOptionsType} options - Options for generating accent palettes.\n * @example\n * ```ts\n * const colors = {\n * monochromatic: ['#ff0000', '#00ff00'],\n * // other base palettes...\n * };\n * const options = { baseColor: { color: '#ff0000', name: 'Red', hex: '#ff0000' }, numberOfColors: 9 };\n * const accentColors = new MoebiusAccentColors(colors, options);\n * ```\n */\n constructor(\n colors: MoebiusPaletteColorsInterface,\n options: MoebiusPaletteOptionsType\n ) {\n Object.keys(colors).forEach((palette) => {\n this[palette] = colors[palette].map((color: MoebiusColorValueHexType) =>\n monochromatic(color, { ...options, numberOfColors: 9 })\n );\n });\n }\n /**\n * Converts the accent palettes to a flat array.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values.\n * @example\n * ```ts\n * const accentColors = new MoebiusAccentColors(baseColors, options);\n * const flatArray = accentColors.toArray();\n * console.log(flatArray); // ['#ff0000', '#00ff00', ...]\n * ```\n */\n toArray(): MoebiusColorValueHexType[] {\n return [\n ...this.interpolate,\n ...this.luminanceShift,\n ...this.monochromatic,\n ...this.complement,\n ...this.split,\n ...this.triadic,\n ...this.tetradic,\n ...this.pentadic,\n ...this.hexadic,\n ...this.analogous\n ].flat();\n }\n}\n","import {\n MoebiusColorValueHexType,\n MoebiusPaletteColorsInterface\n} from '../types';\n\n/**\n * Class representing a set of colors in various palettes.\n */\nexport class MoebiusPaletteColors implements MoebiusPaletteColorsInterface {\n interpolate: MoebiusColorValueHexType[];\n luminanceShift: MoebiusColorValueHexType[];\n monochromatic: MoebiusColorValueHexType[];\n complement: MoebiusColorValueHexType[];\n split: MoebiusColorValueHexType[];\n triadic: MoebiusColorValueHexType[];\n tetradic: MoebiusColorValueHexType[];\n pentadic: MoebiusColorValueHexType[];\n hexadic: MoebiusColorValueHexType[];\n analogous: MoebiusColorValueHexType[];\n\n /**\n * Creates an instance of MoebiusPaletteColors.\n * @param {MoebiusPaletteColorsInterface} colors - Palette colors to initialize with.\n * @example\n * ```ts\n * const colors = {\n * interpolate: ['#ff0000', '#00ff00'],\n * // other palettes...\n * };\n * const palette = new MoebiusPaletteColors(colors);\n * ```\n */\n constructor(colors: MoebiusPaletteColorsInterface) {\n Object.keys(colors).forEach((palette) => {\n this[palette] = colors[palette];\n });\n }\n\n /**\n * Converts the palettes to a flat array.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values.\n * @example\n * ```ts\n * const palette = new MoebiusPaletteColors({ interpolate: ['#ff0000', '#00ff00'] });\n * const flatArray = palette.toArray();\n * console.log(flatArray); // ['#ff0000', '#00ff00']\n * ```\n */\n toArray(): MoebiusColorValueHexType[] {\n return [\n ...this.interpolate,\n ...this.luminanceShift,\n ...this.monochromatic,\n ...this.complement,\n ...this.split,\n ...this.triadic,\n ...this.tetradic,\n ...this.pentadic,\n ...this.hexadic,\n ...this.analogous\n ].flat();\n }\n}\n","import {\n MoebiusColorValueHexType,\n MoebiusThemeColorsInterface\n} from '../types';\n\n/**\n * Class representing a set of colors in various themes.\n */\nexport class MoebiusThemeColors implements MoebiusThemeColorsInterface {\n darkmode: Record<string, MoebiusColorValueHexType[]>;\n\n /**\n * Creates an instance of MoebiusThemeColors.\n * @param {MoebiusThemeColorsInterface} colors - Palette colors to initialize with.\n * @example\n * ```ts\n * const colors = {\n * interpolate: ['#ff0000', '#00ff00'],\n * // other themes...\n * };\n * const theme = new MoebiusThemeColors(colors);\n * ```\n */\n constructor(colors: MoebiusThemeColorsInterface) {\n Object.keys(colors).forEach((theme) => {\n this[theme] = colors[theme];\n });\n }\n}\n","import { MOEBIUS_PALETTE_DEFAULT_OPTIONS } from '../constants';\nimport * as FEATURES from '../features';\nimport {\n MoebiusColorValueHexType,\n MoebiusColorInterface,\n MoebiusPaletteAccentColorsInterface,\n MoebiusPaletteColorsInterface,\n MoebiusPaletteDefaultOptionsType,\n MoebiusPaletteOptionsType,\n MoebiusPaletteInterface,\n MoebiusChromaColorInputType,\n MoebiusThemeColorsInterface\n} from '../types';\n\nimport { MoebiusAccentColors } from './MoebiusAccentColors';\nimport { MoebiusPaletteColors } from './MoebiusPaletteColors';\nimport { MoebiusThemeColors } from './MoebiusThemeColors';\n\n/**\n * MoebiusPalettes class representing a set of color palettes and their variations.\n * @class\n */\nexport class MoebiusPalettes implements MoebiusPaletteInterface {\n baseColor: MoebiusColorInterface;\n secondaryColor: MoebiusColorInterface;\n colors: Record<string, unknown> | MoebiusPaletteColorsInterface = {};\n themes: Record<string, unknown> | MoebiusThemeColorsInterface = {};\n defaultOptions: MoebiusPaletteDefaultOptionsType = {\n ...MOEBIUS_PALETTE_DEFAULT_OPTIONS,\n divergentColor: '#f5f5f5'\n };\n options: MoebiusPaletteOptionsType;\n all: MoebiusColorValueHexType[] = [];\n accents: MoebiusPaletteAccentColorsInterface;\n\n /**\n * Creates an instance of MoebiusPalettes.\n * @param {MoebiusPaletteOptionsType} options - Options for configuring the palettes.\n */\n constructor(options: MoebiusPaletteOptionsType) {\n this.options = { ...this.defaultOptions, ...options };\n this.baseColor = this.options.baseColor;\n this.secondaryColor = this.options.secondaryColor;\n this.themes = new MoebiusThemeColors({\n darkmode: this.darkmode(this.baseColor.hex, this.secondaryColor.hex, {\n ...this.options,\n reverseDirection: !this.options.reverseDirection\n })\n });\n this.colors = new MoebiusPaletteColors({\n interpolate: this.interpolate(\n this.baseColor.hex,\n this.secondaryColor.hex,\n this.options\n ),\n luminanceShift: this.luminanceShift(\n [this.baseColor.hex],\n [this.secondaryColor.hex],\n this.options\n ),\n monochromatic: this.monochromatic(this.baseColor.hex),\n complement: this.complement(this.baseColor.hex),\n split: this.split(this.baseColor.hex),\n triadic: this.triadic(this.baseColor.hex),\n tetradic: this.tetradic(this.baseColor.hex),\n pentadic: this.pentadic(this.baseColor.hex),\n hexadic: this.hexadic(this.baseColor.hex),\n analogous: this.analogous(this.baseColor.hex)\n });\n\n this.accents = new MoebiusAccentColors(this.colors, this.options);\n\n this.all = [\n ...new Set(\n [\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(this.accents as any).toArray(),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(this.colors as any).toArray()\n ].flat()\n )\n ];\n }\n\n /**\n * Generate a complement color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the complement palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.<\n * @param {number} [options.numberOfColors=8] - The number of colors in the complement palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the complement palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const complementPalette = complement(baseColor, { numberOfColors: 5 });\n * console.log(complementPalette); // ['#3498db', '#db3434', '#75db34', '#dbd134', '#db7434']\n * ```\n */\n complement(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.complement(color, currentOptions);\n }\n\n /**\n * Generates a dark mode color palette based on the provided base and secondary colors.\n * @param {MoebiusChromaColorInputType} baseColor - The base color for the palette.\n * @param {MoebiusChromaColorInputType} secondaryColor - The secondary color for the palette.\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} [options={}] - Palette options.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation for color scales.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma.mix.\n * @param {boolean} [options.noDuplicates=true] - Whether to remove duplicate colors from the palette.\n * @returns {Record<string, MoebiusColorValueHexType[]>} - The generated dark mode color palette.\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const secondaryColor = '#2ecc71';\n * const options = { bezier: true, colorScaleMode: 'lch' };\n * const palette = darkmode(baseColor, secondaryColor, options);\n * console.log(palette);\n * ```\n */\n darkmode(\n baseColor: MoebiusChromaColorInputType,\n secondaryColor: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): Record<string, MoebiusColorValueHexType[]> {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.darkmode(baseColor, secondaryColor, currentOptions);\n }\n\n /**\n * Generate a split color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the split palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the split palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the split palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const splitPalette = split(baseColor, { numberOfColors: 5 });\n * console.log(splitPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\n split(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.split(color, currentOptions);\n }\n\n /**\n * Generates a triadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in various formats (HEX, RGB, HSL, etc.).\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} options - Additional options for palette generation.\n * @param {number} [options.numberOfColors=8] - The number of colors in the generated palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for the generated palette.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} An array of HEX values representing the triadic color palette.\n *\n * @example\n * ```ts\n * const triadicPalette = triadic('#3498db', { numberOfColors: 5 });\n * console.log(triadicPalette);\n * // Output: ['#3498db', '#db344f', '#4fdb34', '#9834db', '#34db98']\n * ```\n */\n triadic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.triadic(color, currentOptions);\n }\n\n /**\n * Generate a tetradic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the tetradic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the tetradic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the tetradic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const tetradicPalette = tetradic(baseColor, { numberOfColors: 5 });\n * console.log(tetradicPalette); // ['#3498db', '#db3434', '#34db99', '#dbd134', '#8f34db']\n * ```\n */\n tetradic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.tetradic(color, currentOptions);\n }\n\n /**\n * Generate a pentadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the pentadic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the pentadic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the pentadic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const pentadicPalette = pentadic(baseColor, { numberOfColors: 5 });\n * console.log(pentadicPalette); // ['#3498db', '#dbd134', '#db3434', '#34db99', '#8f34db']\n * ```\n */\n pentadic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.pentadic(color, currentOptions);\n }\n\n /**\n * Generate a hexadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the hexadic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the hexadic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the hexadic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const hexadicPalette = hexadic(baseColor, { numberOfColors: 5 });\n * console.log(hexadicPalette); // ['#3498db', '#5d7f33', '#8473a9', '#ad7a95', '#db3434']\n * ```\n */\n hexadic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.hexadic(color, currentOptions);\n }\n\n /**\n * Generate an analogous color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the analogous palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the analogous palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the analogous palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const analogousPalette = analogous(baseColor, { numberOfColors: 5 });\n * console.log(analogousPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#db3474']\n * ```\n */\n analogous(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.analogous(color, currentOptions);\n }\n\n /**\n * Interpolate between two colors and generate a color palette.\n *\n * @param {MoebiusChromaColorInputType} primaryColor - The starting color for interpolation.\n * @param {MoebiusChromaColorInputType} secondaryColor - The ending color for interpolation.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the interpolated palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the interpolated palette.\n *\n * @example\n * ```ts\n * const startColor = '#3498db';\n * const endColor = '#db3434';\n * const interpolatedPalette = interpolate(startColor, endColor, { numberOfColors: 5 });\n * console.log(interpolatedPalette); // ['#3498db', '#5d6d7e', '#8473a9', '#ad7a95', '#db3434']\n * ```\n */\n interpolate(\n primaryColor: MoebiusColorValueHexType,\n secondaryColor: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.interpolate(primaryColor, secondaryColor, currentOptions);\n }\n /**\n * Generate a luminance shift palette based on an array of colors, with optional diverging colors.\n *\n * @param {MoebiusChromaColorInputType[]} colors - Array of base colors for generating the luminance shift palette.\n * @param {MoebiusChromaColorInputType[]} [divergingColors=[]] - Array of diverging colors.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The total number of colors in the luminance shift palette.\n * @param {boolean} [options.diverging=false] - Whether to generate a diverging palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation.\n * @param {string} [options.divergentColor='#f5f5f5'] - The divergent color for a diverging palette.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the luminance shift palette.\n *\n * @example\n * ```ts\n * const baseColors = ['#3498db', '#99db34'];\n * const divergingColors = ['#db3434'];\n * const luminanceShiftPalette = luminanceShift(baseColors, divergingColors, { numberOfColors: 5 });\n * console.log(luminanceShiftPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\n luminanceShift(\n colors: MoebiusColorValueHexType[],\n divergingColors: MoebiusColorValueHexType[] = [],\n\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.luminanceShift(colors, divergingColors, currentOptions);\n }\n\n /**\n * Generates a monochromatic color palette based on the given color.\n * @param {MoebiusChromaColorInputType} color - The base color for the palette.\n * @param {MoebiusPaletteOptionsType} options - Options for generating the palette.\n * @returns {MoebiusColorValueHexType[]} - An array of hex color values in the palette.\n * @example\n * ```typescript\n * const baseColor = '#003f5c';\n * const options = { numberOfColors: 5, bezier: true, randomOffset: false };\n * const monochromaticPalette = monochromatic(baseColor, options);\n * console.log(monochromaticPalette);\n * [\n * '#003f5c', // maniacMansion,\n * '#014268', // darkImperialBlue,\n * '#024575', // macraggeBlue,\n * '#044784', // bridgeport,\n * '#064898', // frightNight,\n * '#0745b6', // absoluteZero,\n * '#002df5', // blueBouquet\n * ];\n * ```\n */\n monochromatic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.monochromatic(color, currentOptions);\n }\n /**\n * Generate a harmonized color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the harmonized palette.\n * @param {number} start - The starting angle for generating harmonized colors (degrees).\n * @param {number} end - The ending angle for generating harmonized colors (degrees).\n * @param {number} interval - The interval between harmonized colors (degrees).\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {boolean} [options.noDuplicates=true] - Whether to remove duplicate colors in the palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the harmonized palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const harmonizedPalette = harmonize(baseColor, 30, 210, 30, { noDuplicates: true });\n * console.log(harmonizedPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#3498db']\n * ```\n */\n harmonize(\n color: MoebiusColorValueHexType,\n start: number,\n end: number,\n interval: number,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.harmonize(color, start, end, interval, currentOptions);\n }\n}\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a complement color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the complement palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the complement palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the complement palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const complementPalette = complement(baseColor, { numberOfColors: 5 });\n * console.log(complementPalette); // ['#3498db', '#db3434', '#75db34', '#dbd134', '#db7434']\n * ```\n */\nexport const complement = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a complement color scheme.\n const colors = harmonize(color, 180, 180, 1);\n\n // Use chroma-js to fill in missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\nimport { getChromaBezierScaleColors } from '../utils/get-chroma-bezier-scale-colors';\nimport { getChromaScaleColors } from '../utils/get-chroma-scale-colors';\n\nimport { monochromatic } from './monochromatic';\n\n/**\n * Generates a dark mode color palette based on the provided base and secondary colors.\n * @param {MoebiusChromaColorInputType} baseColor - The base color for the palette.\n * @param {MoebiusChromaColorInputType} secondaryColor - The secondary color for the palette.\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} [options={}] - Palette options.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation for color scales.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma.mix.\n * @param {boolean} [options.noDuplicates=true] - Whether to remove duplicate colors from the palette.\n * @returns {Record<string, MoebiusColorValueHexType[]>} - The generated dark mode color palette.\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const secondaryColor = '#2ecc71';\n * const options = { bezier: true, colorScaleMode: 'lch' };\n * const palette = darkmode(baseColor, secondaryColor, options);\n * console.log(palette);\n * ```\n */\nexport const darkmode = (\n baseColor: MoebiusChromaColorInputType,\n secondaryColor: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): Record<string, MoebiusColorValueHexType[]> => {\n const {\n bezier = false,\n colorScaleMode,\n noDuplicates = true\n } = options as MoebiusPaletteOptionsType;\n const ratio = 0.99;\n const ratioMultiplier = 0.02;\n const primaryAccents = monochromatic(baseColor, options);\n const surfaceAccents = monochromatic(secondaryColor, options);\n const mixedAccents = surfaceAccents.map((hex, index) => {\n return chroma\n .mix(\n primaryAccents[index],\n hex,\n ratio - index * ratioMultiplier,\n colorScaleMode\n )\n .hex();\n });\n const palette = {\n primary: primaryAccents,\n surface: surfaceAccents,\n mixed: mixedAccents\n };\n\n if (noDuplicates) {\n palette.primary = [...new Set(primaryAccents)];\n palette.surface = [...new Set(surfaceAccents)];\n palette.mixed = [...new Set(mixedAccents)];\n }\n\n if (bezier) {\n if (\n palette.primary.length > 1 &&\n palette.surface.length > 1 &&\n palette.mixed.length > 1\n ) {\n palette.primary = getChromaBezierScaleColors(palette.primary, options);\n palette.surface = getChromaBezierScaleColors(palette.surface, options);\n palette.mixed = getChromaBezierScaleColors(palette.mixed, options);\n } else {\n palette.primary = getChromaScaleColors(palette.primary, options);\n palette.surface = getChromaScaleColors(palette.surface, options);\n palette.mixed = getChromaScaleColors(palette.mixed, options);\n }\n }\n\n return palette;\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a split color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the split palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the split palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the split palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const splitPalette = split(baseColor, { numberOfColors: 5 });\n * console.log(splitPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\nexport const split = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a split color scheme.\n const colors = harmonize(color, 150, 210, 60);\n\n // Use chroma-js to fill in the missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generates a triadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in various formats (HEX, RGB, HSL, etc.).\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} options - Additional options for palette generation.\n * @param {number} [options.numberOfColors=8] - The number of colors in the generated palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for the generated palette.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} An array of HEX values representing the triadic color palette.\n *\n * @example\n * ```ts\n * const triadicPalette = triadic('#3498db', { numberOfColors: 5 });\n * console.log(triadicPalette);\n * // Output: ['#3498db', '#db344f', '#4fdb34', '#9834db', '#34db98']\n * ```\n */\nexport const triadic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n const colors = harmonize(color, 120, 240, 120);\n\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a tetradic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the tetradic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the tetradic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the tetradic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const tetradicPalette = tetradic(baseColor, { numberOfColors: 5 });\n * console.log(tetradicPalette); // ['#3498db', '#db3434', '#34db99', '#dbd134', '#8f34db']\n * ```\n */\nexport const tetradic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a tetradic color scheme.\n const colors = harmonize(color, 90, 270, 90);\n\n // Use chroma-js to fill in the missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a pentadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the pentadic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the pentadic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the pentadic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const pentadicPalette = pentadic(baseColor, { numberOfColors: 5 });\n * console.log(pentadicPalette); // ['#3498db', '#dbd134', '#db3434', '#34db99', '#8f34db']\n * ```\n */\nexport const pentadic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a pentadic color scheme.\n const colors = harmonize(color, 144, 360, 72);\n\n // Use chroma-js to fill in colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a hexadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the hexadic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the hexadic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the hexadic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const hexadicPalette = hexadic(baseColor, { numberOfColors: 5 });\n * console.log(hexadicPalette); // ['#3498db', '#5d7f33', '#8473a9', '#ad7a95', '#db3434']\n * ```\n */\nexport const hexadic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a hexadic color scheme.\n const colors = harmonize(color, 120, 360, 60);\n\n // Use chroma-js to fill in missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate an analogous color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the analogous palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the analogous palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the analogous palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const analogousPalette = analogous(baseColor, { numberOfColors: 5 });\n * console.log(analogousPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#db3474']\n * ```\n */\nexport const analogous = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate an analogous color scheme.\n const colors = harmonize(color, 30, 90, 30);\n\n // Use chroma-js to fill in the missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\n/**\n * Interpolate between two colors and generate a color palette.\n *\n * @param {MoebiusChromaColorInputType} primaryColor - The starting color for interpolation.\n * @param {MoebiusChromaColorInputType} secondaryColor - The ending color for interpolation.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the interpolated palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the interpolated palette.\n *\n * @example\n * ```ts\n * const startColor = '#3498db';\n * const endColor = '#db3434';\n * const interpolatedPalette = interpolate(startColor, endColor, { numberOfColors: 5 });\n * console.log(interpolatedPalette); // ['#3498db', '#5d6d7e', '#8473a9', '#ad7a95', '#db3434']\n * ```\n */\nexport const interpolate = (\n primaryColor: MoebiusChromaColorInputType,\n secondaryColor: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n bezier = false,\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n let colors = chroma\n .scale([primaryColor, secondaryColor])\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n\n if (bezier) {\n colors = chroma\n .bezier([primaryColor, secondaryColor])\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n }\n\n return colors;\n};\n","import { MoebiusColorValueHexType } from '../types';\nimport { getStartMaskDegree } from '../utils/svg/get-start-mask-degree';\nimport { pieSlice } from '../utils/svg/pie-slice';\nimport { uniqueID } from '../utils/unique-id';\n\n/**\n * Helper class for generating SVG paths for colored pie slices.\n */\nexport class MoebiusSVGHelper {\n xlmns = 'http://www.w3.org/2000/svg';\n\n /**\n * Gets SVG paths for colored pie slices based on the provided colors.\n * @param {MoebiusColorValueHexType[][]} colors - Array of color groups.\n * @param {number} [size=256] - Size of the SVG.\n * @returns {DocumentFragment} - Document fragment containing the SVG paths.\n * @example\n * ```ts\n * const svgHelper = new MoebiusSVGHelper();\n * const colors = [['#ff0000', '#00ff00'], ['#0000ff']];\n * const svgFragment = svgHelper.getColorPiePaths(colors, 256);\n * document.body.appendChild(svgFragment);\n * ```\n */\n getColorPiePaths(colors: MoebiusColorValueHexType[][], size = 256) {\n const df = document.createDocumentFragment();\n const defsElement = document.createElementNS(this.xlmns, 'defs');\n const maskElement = document.createElementNS(this.xlmns, 'mask');\n const rectElement = document.createElementNS(this.xlmns, 'rect');\n const gElement = document.createElementNS(this.xlmns, 'g');\n const interval = 360 / colors.length;\n const id = uniqueID();\n\n maskElement.setAttributeNS(null, 'id', id);\n rectElement.setAttributeNS(null, 'height', '100%');\n rectElement.setAttributeNS(null, 'width', '100%');\n rectElement.setAttributeNS(null, 'fill', 'white');\n gElement.setAttributeNS(null, 'mask', `url(#${id})`);\n maskElement.appendChild(rectElement);\n\n const maskDegrees = 360 / colors.length;\n const startMaskDegree = getStartMaskDegree(maskDegrees / 2, colors.length);\n\n for (let i = startMaskDegree; i < 360; i += maskDegrees) {\n const lineElement = document.createElementNS(this.xlmns, 'line');\n\n lineElement.setAttributeNS(null, 'x1', '128');\n lineElement.setAttributeNS(null, 'y1', '128');\n lineElement.setAttributeNS(null, 'x2', '0');\n lineElement.setAttributeNS(null, 'y2', '128');\n lineElement.setAttributeNS(null, 'stroke', 'black');\n lineElement.setAttributeNS(null, 'stroke-width', '6');\n lineElement.setAttributeNS(null, 'transform', `rotate(${i} 128 128)`);\n maskElement.appendChild(lineElement);\n }\n\n let start = 0;\n\n colors.forEach((group: string[]) => {\n const inwardInterval = size / 2 / group.length;\n\n start += interval;\n\n return group.forEach((color: MoebiusColorValueHexType, index: number) => {\n const r = size / 2 - index * inwardInterval;\n const path = document.createElementNS(this.xlmns, 'path');\n\n path.setAttributeNS(null, 'fill', color);\n path.setAttributeNS(null, 'data-color-hex', color);\n path.setAttributeNS(null, 'data-r', `${r}`);\n path.setAttributeNS(null, 'd', pieSlice(start, interval, r));\n gElement.appendChild(path);\n });\n });\n defsElement.appendChild(maskElement);\n df.appendChild(defsElement);\n df.appendChild(gElement);\n\n return df;\n }\n}\n","/**\n * Generates a unique identifier.\n * @returns {string} - A unique identifier.\n * @example\n * ```ts\n * const id = uniqueID();\n * console.log(id); // \"_abc123\"\n * ```\n */\nexport const uniqueID = (): string =>\n '_' + Math.random().toString(36).substring(2, 11);\n","/**\n * Calculates the starting mask degree based on the number of elements in a color group.\n *\n * @param {number} initial - The initial starting degree.\n * @param {number} length - The number of elements in the color group.\n * @returns {number} - The adjusted starting degree for creating a color mask.\n */\nexport const getStartMaskDegree = (initial: number, length: number): number => {\n if (length === 4 || length === 8 || length === 12) {\n return 0;\n } else if (length === 3 || length === 9) {\n return 30;\n } else if (length === 7) {\n return 12;\n } else if (length === 5) {\n return 55;\n }\n\n return initial;\n};\n","/**\n * Generates an SVG path representing a pie slice.\n *\n * @param {number} start - Starting angle of the pie slice in degrees.\n * @param {number} interval - Angular interval of the pie slice in degrees.\n * @param {number} radius - Radius of the circle.\n * @param {number} size - Size of the circle. Default is 256.\n * @returns {string} - SVG path representing the pie slice.\n */\nexport const pieSlice = (\n start: number,\n interval: number,\n radius: number,\n size = 256\n) => {\n const centerX = size / 2; // X-coordinate of the circle's center\n const centerY = centerX; // Y-coordinate of the circle's center\n\n let stop = start + interval;\n\n // Ensure start is smaller than stop\n if (start > stop) {\n const temp = start;\n\n start = stop;\n stop = temp;\n }\n\n // Calculate start and end points\n const startX = centerX + radius * Math.cos((-start + 90) * (Math.PI / 180));\n const startY = centerY + radius * Math.sin((-start + 90) * (Math.PI / 180));\n const endX = centerX + radius * Math.cos((-stop + 90) * (Math.PI / 180));\n const endY = centerY + radius * Math.sin((-stop + 90) * (Math.PI / 180));\n const largeArcFlag = stop - start <= 180 ? '0' : '1';\n\n // Create the SVG path\n return `M ${startX} ${startY} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${endX} ${endY} L ${centerX} ${centerY} Z`;\n};\n","/* eslint-disable import/no-unused-modules */\nimport chroma from 'chroma-js';\nimport nearestColor from 'nearest-color';\n\nimport { MoebiusColor } from './classes/MoebiusColor';\nimport { MoebiusPalettes } from './classes/MoebiusPalettes';\nimport { MoebiusSVGHelper } from './classes/MoebiusSVGHelper';\nimport {\n MoebiusColorValueHexType,\n NearestColorColorMatchInterface\n} from './types';\n\nexport * from './types';\n\nexport type MoebiusReturnType = Promise<{\n MoebiusColor: typeof MoebiusColor;\n MoebiusPalettes: typeof MoebiusPalettes;\n MoebiusSVGHelper: typeof MoebiusSVGHelper;\n}>;\n\nconst initializeColorNames = async (): Promise<\n // eslint-disable-next-line no-unused-vars\n (color: string) => NearestColorColorMatchInterface | string\n> => {\n const response = await fetch('https://color-names.herokuapp.com/v1/');\n const data = await response.json();\n const colors = data.colors;\n const map = {};\n\n colors.forEach((entry: Record<string, unknown>) => {\n map[entry.name as string] = entry.hex;\n });\n\n return nearestColor.from(map);\n};\n\n/**\n * Asynchronous function to initialize Moebius with required data\n * @function\n * @returns {MoebiusReturnType} An object with Moebius classes\n *\n */\nasync function Moebius(): MoebiusReturnType {\n const colorNames = await initializeColorNames();\n\n class MoebiusColorAbstract extends MoebiusColor {\n constructor(color: MoebiusColorValueHexType) {\n super(\n chroma(color).hex(),\n typeof colorNames(color) === 'string'\n ? (colorNames(color) as string)\n : (colorNames(color) as NearestColorColorMatchInterface).name\n );\n }\n }\n\n return {\n MoebiusColor: MoebiusColorAbstract as typeof MoebiusColor,\n MoebiusPalettes,\n MoebiusSVGHelper\n };\n}\n\nexport default Moebius;\n"],"names":["exports","limit$2","x","min","max","limit$1","clip_rgb$3","rgb","_clipped","_unclipped","slice","i","classToType","i$1","list$1","length","name","toLowerCase","type$p","obj","Object","prototype","toString","call","type$o","unpack$B","args","keyOrder","Array","split","filter","k","undefined","map","type$n","last$4","l","PI$2","Math","PI","utils","clip_rgb","limit","type","unpack","last","TWOPI","PITHIRD","DEG2RAD","RAD2DEG","input$h","format","autodetect","last$3","clip_rgb$2","type$m","_input","Color$D","len","arguments","me","this","constructor","mode","sorted","sort","a","b","p","list","chk","test","apply","Error","_rgb","push","hex","join","Color_1","chroma$k","Function","bind","Color","concat","version","chroma_1","unpack$A","max$2","rgb2cmyk$1","ref","r","g","f","rgb2cmyk_1","unpack$z","cmyk2rgb","c","m","y","alpha","cmyk2rgb_1","chroma$j","Color$C","input$g","unpack$y","type$l","rgb2cmyk","cmyk","unpack$x","last$2","rnd","round","hsl2css$1","hsla","hsl2css_1","unpack$w","rgb2hsl$3","s","h","Number","NaN","rgb2hsl_1","unpack$v","last$1","hsl2css","rgb2hsl$2","round$6","rgb2css$1","rgba","substr","rgb2css_1","unpack$u","round$5","hsl2rgb$1","assign","t3","t2","t1","h_","hsl2rgb_1","hsl2rgb","input$f","RE_RGB","RE_RGBA","RE_RGB_PCT","RE_RGBA_PCT","RE_HSL","RE_HSLA","round$4","css2rgb$1","css","trim","named","e","match","rgb$1","rgb$2","i$2","rgb$3","i$3","hsl","rgb$4","hsl$1","rgb$5","css2rgb_1","chroma$i","Color$B","input$e","type$k","rgb2css","css2rgb","rest","Color$A","chroma$h","input$d","unpack$t","gl","unpack$s","rgb2hcg$1","delta","_g","rgb2hcg_1","unpack$r","floor$3","floor","hcg2rgb","assign$1","assign$2","assign$3","assign$4","assign$5","_c","q","t","v","hcg2rgb_1","unpack$q","type$j","chroma$g","Color$z","input$c","rgb2hcg","hcg","unpack$p","round$3","rgb2hex$2","str","hxa","rgb2hex_1","RE_HEX","RE_HEXA","hex2rgb_1","u","parseInt","u$1","chroma$f","Color$y","type$i","input$b","rgb2hex$1","indexOf","unpack$o","TWOPI$2","min$2","sqrt$4","sqrt","acos","rgb2hsi$1","min_","rgb2hsi_1","unpack$n","TWOPI$1","cos$4","cos","hsi2rgb","isNaN","hsi2rgb_1","unpack$m","type$h","chroma$e","Color$x","input$a","rgb2hsi","hsi","unpack$l","type$g","chroma$d","Color$w","input$9","rgb2hsl$1","unpack$k","min$1","max$1","rgb2hsl","max_","rgb2hsv$1","unpack$j","floor$2","hsv2rgb","hsv2rgb_1","unpack$i","type$f","chroma$c","Color$v","input$8","rgb2hsv","hsv","labConstants","Kn","Xn","Yn","Zn","t0","LAB_CONSTANTS$3","unpack$h","pow$a","pow","rgb2lab$2","ref$1","rgb2xyz","rgb_xyz","xyz_lab","rgb2lab_1","LAB_CONSTANTS$2","unpack$g","pow$9","lab2rgb$1","z","lab_xyz","xyz_rgb","lab2rgb_1","unpack$f","type$e","chroma$b","Color$u","input$7","rgb2lab$1","lab","unpack$e","sqrt$3","atan2$2","atan2","round$2","lab2lch$2","lab2lch_1","unpack$d","rgb2lab","lab2lch$1","rgb2lch$1","b_","rgb2lch_1","unpack$c","sin$3","sin","cos$3","lch2lab$2","lch2lab_1","unpack$b","lch2lab$1","lab2rgb","lch2rgb$1","L","lch2rgb_1","unpack$a","lch2rgb","hcl2rgb","hcl","reverse","hcl2rgb_1","unpack$9","type$d","chroma$a","Color$t","input$6","rgb2lch","lch","forEach","w3cx11_1","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflower","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","laserlemon","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrod","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","maroon2","maroon3","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","purple2","purple3","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","Color$s","input$5","type$c","w3cx11","hex2rgb","rgb2hex","keys","n","unpack$8","rgb2num$1","rgb2num_1","type$b","num2rgb_1","num","chroma$9","Color$r","input$4","type$a","rgb2num","chroma$8","Color$q","input$3","unpack$7","type$9","round$1","log$1","log","temperature2rgb_1","kelvin","temp","temperature2rgb","unpack$6","rgb2temperature$1","minTemp","maxTemp","eps","chroma$7","Color$p","input$2","rgb2temperature","temperature","unpack$5","cbrt","pow$8","sign$1","sign","rgb2oklab$2","rgb2lrgb","lr","lg","lb","rgb2oklab_1","abs","unpack$4","pow$7","oklab2rgb$1","lrgb2rgb","oklab2rgb_1","unpack$3","type$8","chroma$6","Color$o","input$1","rgb2oklab$1","oklab","unpack$2","rgb2oklab","lab2lch","rgb2oklch$1","rgb2oklch_1","unpack$1","lch2lab","oklab2rgb","oklch2rgb","oklch2rgb_1","type$7","chroma$5","Color$n","input","rgb2oklch","oklch","Color$m","type$6","mutate","clipped","Color$k","LAB_CONSTANTS$1","darken","amount","brighten","darker","brighter","get","mc","channel","src","Color$i","type$5","pow$6","EPS","MAX_ITER","luminance","lum","cur_lum","max_iter","low","high","mid","interpolate","lm","rgb2luminance","luminance_x","interpolator$1","Color$h","type$4","interpolator","mix$1","col1","col2","Color$g","mix","Color$f","premultiply","Color$e","LAB_CONSTANTS","saturate","desaturate","Color$d","type$3","set","value","charAt","out","Color$c","xyz0","xyz1","Color$b","sqrt$2","pow$5","lrgb","x1","y1","z1","x2","y2","z2","Color$a","Color$9","_hsx","hue0","hue1","sat0","sat1","lbv0","lbv1","sat","hue","lbv","interpolate_hsx$5","Color$8","c1","c2","interpolate_hsx$4","interpolate_hsx$3","interpolate_hsx$2","interpolate_hsx$1","Color$7","interpolate_hsx","Color$6","clip_rgb$1","pow$4","sqrt$1","PI$1","cos$2","sin$2","atan2$1","average","colors","weights","from","reduce","w","_average_lrgb","first","shift","xyz","cnt","dx","dy","A","ci","xyz2","A$1","col","chroma$4","type$2","pow$3","scale$2","_mode","_nacol","_spread","_domain","_pos","_padding","_classes","_colors","_out","_min","_max","_correctLightness","_colorCache","_useCache","_gamma","setColors","brewer","c$1","resetCache","getClass","tMapLightness","tMapDomain","getColor","val","bypassMap","classes","d","analyze","limits","domain","tOut","tBreaks","every","_m","range","_o","spread","correctLightness","L0","L1","pol","L_actual","L_ideal","L_diff","padding","numColors","result","dm","dd","__range__","samples","end","asc","cache","gamma","nodata","left","right","inclusive","ascending","Color$5","scale$1","binom_row","row","newrow","j","bezier","I","lab0","lab1","lab2","lab3","RangeError","labs","sum","el","bezier_1","scale","chroma$3","blend","bottom","top","blend_f","c0","each","normal","multiply","lighten","screen","overlay","burn","dodge","blend_1","type$1","pow$2","sin$1","cos$1","chroma$2","cubehelix","start","rotations","lightness","dl","dh","fract","amp","cos_a","sin_a","Color$4","digits","floor$1","random","random_1","code","pow$1","abs$1","data","key","MAX_VALUE","values","count","min_log","LOG10E","max_log","pb","pr","cluster","assignments","clusterSizes","repeat","nb_iters","centroids","i$4","mindist","best","j$1","dist","newCentroids","j$2","i$5","j$3","j$4","kClusters","j$5","i$6","tmpKMeansBreaks","j$6","i$7","analyze_1","Color$3","contrast","l1","l2","Color$2","exp","deltaE","Kl","Kc","Kh","rad2deg","rad","deg2rad","deg","a1","b1","L2","a2","b2","avgL","avgC","G","a1p","a2p","C1p","C2p","avgCp","arctan1","arctan2","h1p","h2p","avgHp","T","deltaHp","deltaL","deltaCp","sl","sc","sh","deltaTheta","Rt","Color$1","distance","sum_sq","valid","chroma$1","scales","cool","hot","colorbrewer","OrRd","PuBu","BuPu","Oranges","BuGn","YlOrBr","YlGn","Reds","RdPu","Greens","YlGnBu","Purples","GnBu","Greys","YlOrRd","PuRd","Blues","PuBuGn","Viridis","Spectral","RdYlGn","RdBu","PiYG","PRGn","RdYlBu","BrBG","RdGy","PuOr","Set2","Accent","Set1","Set3","Dark2","Paired","Pastel2","Pastel1","colorbrewer_1","chroma","chroma_js","factory","context","nearestColor","needle","parseColor","distanceSq","minDistanceSq","Infinity","DEFAULT_COLORS","source","mapColors","color","createColorSpec","STANDARD_COLORS","hexMatch","substring","rgbMatch","parseComponentValue","leadingZero","string","availableColors","nearestColorBase","matcher","or","alternateColors","extendedColors","VERSION","module","UnitHSL","toFixed","UnitHSLFloat","UnitXYZ","UnitCMYK","UnitRGBFloat","UnitHWB","UnitLAB","UnitOKLAB","UnitHSV","UnitLCH","UnitOKLCH","UnitHSI","toFloat","normalizeRGBInput","normalizeLABInput","MoebiusColor","hwb","rgbFloat","hslFloat","CONVERTERS.toHEX","CONVERTERS.toCMYK","CONVERTERS.toXYZ","CONVERTERS.toHSL","CONVERTERS.toHWB","CONVERTERS.toLAB","CONVERTERS.toOKLAB","CONVERTERS.toHSV","CONVERTERS.toLCH","CONVERTERS.toOKLCH","CONVERTERS.toHSI","CONVERTERS.toRGB","CONVERTERS.toFloat","toObject","CONVERTERS.toObject","MOEBIUS_PALETTE_DEFAULT_OPTIONS","diverging","randomOffset","noDuplicates","colorScaleMode","reverseDirection","harmonize","interval","options","h1","uniqueColors","Set","monochromatic","numberOfColors","hslColors","generateLuminanceShiftPalette","lRange","lStep","lStart","colorRange","stop","offset","diff","luminanceShiftAutoColors","divergentColor","ceil","getChromaBezierScaleColors","getChromaScaleColors","MoebiusAccentColors","luminanceShift","complement","triadic","tetradic","pentadic","hexadic","analogous","palette","toArray","flat","MoebiusPaletteColors","MoebiusThemeColors","darkmode","theme","MoebiusPalettes","baseColor","secondaryColor","themes","defaultOptions","all","accents","FEATURES.complement","primaryAccents","surfaceAccents","mixedAccents","index","primary","surface","mixed","FEATURES.darkmode","FEATURES.split","FEATURES.triadic","FEATURES.tetradic","FEATURES.pentadic","FEATURES.hexadic","FEATURES.analogous","primaryColor","FEATURES.interpolate","divergingColors","even","numberOfColorsLeft","numberOfColorsRight","generatedColors","generatedDivergentColors","stepsLeft","stepsRight","steps","FEATURES.luminanceShift","currentOptions","FEATURES.monochromatic","FEATURES.harmonize","MoebiusSVGHelper","xlmns","getColorPiePaths","size","df","document","createDocumentFragment","defsElement","createElementNS","maskElement","rectElement","gElement","id","setAttributeNS","appendChild","maskDegrees","initial","lineElement","group","inwardInterval","path","radius","centerX","centerY","pieSlice","async","Moebius","colorNames","response","fetch","json","entry","initializeColorNames","super"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0DoFA,QAG1E,WA2BN,IAzBA,IAAIC,EAAU,SAAUC,EAAGC,EAAKC,GAI5B,YAHa,IAARD,IAAiBA,EAAI,QACb,IAARC,IAAiBA,EAAI,GAEnBF,EAAIC,EAAMA,EAAMD,EAAIE,EAAMA,EAAMF,CAC/C,EAEQG,EAAUJ,EAEVK,EAAa,SAAUC,GACvBA,EAAIC,UAAW,EACfD,EAAIE,WAAaF,EAAIG,MAAM,GAC3B,IAAK,IAAIC,EAAE,EAAGA,GAAG,EAAGA,IACZA,EAAI,IACAJ,EAAII,GAAK,GAAKJ,EAAII,GAAK,OAAOJ,EAAIC,UAAW,GACjDD,EAAII,GAAKN,EAAQE,EAAII,GAAI,EAAG,MACf,IAANA,IACPJ,EAAII,GAAKN,EAAQE,EAAII,GAAI,EAAG,IAGpC,OAAOJ,CACf,EAGQK,EAAc,CAAA,EACTC,EAAM,EAAGC,EAAS,CAAC,UAAW,SAAU,SAAU,WAAY,QAAS,OAAQ,SAAU,YAAa,QAASD,EAAMC,EAAOC,OAAQF,GAAO,EAAG,CACnJ,IAAIG,EAAOF,EAAOD,GAElBD,EAAa,WAAaI,EAAO,KAAQA,EAAKC,aACjD,CACD,IAAIC,EAAS,SAASC,GAClB,OAAOP,EAAYQ,OAAOC,UAAUC,SAASC,KAAKJ,KAAS,QACnE,EAEQK,EAASN,EAETO,EAAW,SAAUC,EAAMC,GAI3B,YAHkB,IAAbA,IAAsBA,EAAS,MAGhCD,EAAKX,QAAU,EAAYa,MAAMP,UAAUX,MAAMa,KAAKG,GAGtC,UAAnBF,EAAOE,EAAK,KAAmBC,EAC3BA,EAASE,MAAM,IACpBC,QAAO,SAAUC,GAAK,YAAsBC,IAAfN,EAAK,GAAGK,MAC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K/nB,EAAI,EAUJ+iC,GAazB,MAAO,CACLnI,aAZF,cAAmCA,EACjC,WAAA/4B,CAAY82B,GACVqK,MACElL,EAAOa,GAAOh2B,MACe,iBAAtB+/B,EAAW/J,GACb+J,EAAW/J,GACX+J,EAAW/J,GAA2C55B,KAE9D,GAKD2/B,kBACAqC,mBAEJ","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"moebius.js","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/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/hsl/rgb2hsl.js","../node_modules/chroma-js/src/io/css/rgb2css.js","../node_modules/chroma-js/src/io/hsl/hsl2rgb.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/hcg/hcg2rgb.js","../node_modules/chroma-js/src/io/hcg/index.js","../node_modules/chroma-js/src/io/hcg/rgb2hcg.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/hex/index.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/io/hsl/index.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/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/io/lch/lch2lab.js","../node_modules/chroma-js/src/io/lch/lch2rgb.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/io/lch/hcl2rgb.js","../node_modules/chroma-js/src/colors/w3cx11.js","../node_modules/chroma-js/src/io/named/index.js","../node_modules/chroma-js/src/io/num/index.js","../node_modules/chroma-js/src/io/num/rgb2num.js","../node_modules/chroma-js/src/io/num/num2rgb.js","../node_modules/chroma-js/src/io/rgb/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/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/io/oklch/index.js","../node_modules/chroma-js/src/io/oklch/rgb2oklch.js","../node_modules/chroma-js/src/io/oklch/oklch2rgb.js","../node_modules/chroma-js/src/ops/alpha.js","../node_modules/chroma-js/src/ops/clipped.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/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/interpolator/num.js","../node_modules/chroma-js/src/interpolator/hcg.js","../node_modules/chroma-js/src/interpolator/hsi.js","../node_modules/chroma-js/src/interpolator/hsl.js","../node_modules/chroma-js/src/interpolator/hsv.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/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/delta-e.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/index.js","../node_modules/chroma-js/src/generator/bezier.js","../node_modules/chroma-js/src/utils/contrast.js","../node_modules/chroma-js/src/utils/distance.js","../node_modules/nearest-color/nearestColor.js","../src/utils/color-objects/hsl.ts","../src/utils/color-objects/xyz.ts","../src/utils/color-objects/cmyk.ts","../src/utils/color-objects/rgb.ts","../src/utils/color-objects/hwb.ts","../src/utils/color-objects/lab.ts","../src/utils/color-objects/oklab.ts","../src/utils/color-objects/hsv.ts","../src/utils/color-objects/lch.ts","../src/utils/color-objects/oklch.ts","../src/utils/color-objects/hsi.ts","../src/utils/converters/to-float.ts","../src/utils/normalize-color-units.ts","../src/classes/MoebiusColor.ts","../src/utils/converters/to-hex.ts","../src/utils/converters/to-cmyk.ts","../src/utils/converters/to-xyz.ts","../src/utils/converters/to-hsl.ts","../src/utils/converters/to-hwb.ts","../src/utils/converters/to-lab.ts","../src/utils/converters/to-oklab.ts","../src/utils/converters/to-hsv.ts","../src/utils/converters/to-lch.ts","../src/utils/converters/to-oklch.ts","../src/utils/converters/to-hsi.ts","../src/utils/converters/to-rgb.ts","../src/utils/converters/to-object.ts","../src/constants/index.ts","../src/features/harmonize.ts","../src/utils/random.ts","../src/features/monochromatic.ts","../src/features/luminance-shift.ts","../src/utils/range.ts","../src/utils/get-chroma-bezier-scale-colors.ts","../src/utils/get-chroma-scale-colors.ts","../src/classes/MoebiusAccentColors.ts","../src/classes/MoebiusPaletteColors.ts","../src/classes/MoebiusThemeColors.ts","../src/classes/MoebiusPalettes.ts","../src/features/complement.ts","../src/features/dark-mode.ts","../src/features/split.ts","../src/features/triadic.ts","../src/features/tetradic.ts","../src/features/pentadic.ts","../src/features/hexadic.ts","../src/features/analogous.ts","../src/features/interpolate.ts","../src/classes/MoebiusSVGHelper.ts","../src/utils/unique-id.ts","../src/utils/svg/get-start-mask-degree.ts","../src/utils/svg/pie-slice.ts","../src/main.ts","../node_modules/@phun-ky/typeof/dist/typeof.js"],"sourcesContent":["import { min, max } from './index.js';\n\nexport default (x, low = 0, high = 1) => {\n return min(max(low, x), high);\n};\n","import limit from './limit.js';\n\nexport default (rgb) => {\n rgb._clipped = false;\n rgb._unclipped = rgb.slice(0);\n for (let i = 0; i <= 3; i++) {\n if (i < 3) {\n if (rgb[i] < 0 || rgb[i] > 255) rgb._clipped = true;\n rgb[i] = limit(rgb[i], 0, 255);\n } else if (i === 3) {\n rgb[i] = limit(rgb[i], 0, 1);\n }\n }\n return rgb;\n};\n","// ported from jQuery's $.type\nconst classToType = {};\nfor (let name of [\n 'Boolean',\n 'Number',\n 'String',\n 'Function',\n 'Array',\n 'Date',\n 'RegExp',\n 'Undefined',\n 'Null'\n]) {\n classToType[`[object ${name}]`] = name.toLowerCase();\n}\nexport default function (obj) {\n return classToType[Object.prototype.toString.call(obj)] || 'object';\n}\n","import type from './type.js';\n\nexport default (args, keyOrder = null) => {\n // if called with more than 3 arguments, we return the arguments\n if (args.length >= 3) return Array.prototype.slice.call(args);\n // with less than 3 args we check if first arg is object\n // and use the keyOrder string to extract and sort properties\n if (type(args[0]) == 'object' && keyOrder) {\n return keyOrder\n .split('')\n .filter((k) => args[0][k] !== undefined)\n .map((k) => args[0][k]);\n }\n // otherwise we just return the first argument\n // (which we suppose is an array of args)\n return args[0];\n};\n","import type from './type.js';\n\nexport default (args) => {\n if (args.length < 2) return null;\n const l = args.length - 1;\n if (type(args[l]) == 'string') return args[l].toLowerCase();\n return null;\n};\n","const { PI, min, max } = Math;\n\nexport { default as clip_rgb } from './clip_rgb.js';\nexport { default as limit } from './limit.js';\nexport { default as type } from './type.js';\nexport { default as unpack } from './unpack.js';\nexport { default as last } from './last.js';\n\nconst TWOPI = PI * 2;\nconst PITHIRD = PI / 3;\nconst DEG2RAD = PI / 180;\nconst RAD2DEG = 180 / PI;\n\nexport { PI, TWOPI, PITHIRD, DEG2RAD, RAD2DEG, min, max };\n","export default {\n format: {},\n autodetect: []\n};\n","import { last, clip_rgb, type } from './utils/index.js';\nimport _input from './io/input.js';\n\nclass Color {\n constructor(...args) {\n const me = this;\n if (\n type(args[0]) === 'object' &&\n args[0].constructor &&\n args[0].constructor === this.constructor\n ) {\n // the argument is already a Color instance\n return args[0];\n }\n // last argument could be the mode\n let mode = last(args);\n let autodetect = false;\n if (!mode) {\n autodetect = true;\n if (!_input.sorted) {\n _input.autodetect = _input.autodetect.sort((a, b) => b.p - a.p);\n _input.sorted = true;\n }\n // auto-detect format\n for (let chk of _input.autodetect) {\n mode = chk.test(...args);\n if (mode) break;\n }\n }\n if (_input.format[mode]) {\n const rgb = _input.format[mode].apply(\n null,\n autodetect ? args : args.slice(0, -1)\n );\n me._rgb = clip_rgb(rgb);\n } else {\n throw new Error('unknown format: ' + args);\n }\n // add alpha channel\n if (me._rgb.length === 3) me._rgb.push(1);\n }\n toString() {\n if (type(this.hex) == 'function') return this.hex();\n return `[${this._rgb.join(',')}]`;\n }\n}\nexport default Color;\n","// this gets updated automatically\nexport const version = '2.6.0';\n","import Color from './Color.js';\nimport { version } from './version.js';\n\nconst chroma = (...args) => {\n return new chroma.Color(...args);\n};\n\nchroma.Color = Color;\nchroma.version = version;\n\nexport default chroma;\n","import { unpack } from '../../utils/index.js';\n\nconst cmyk2rgb = (...args) => {\n args = unpack(args, 'cmyk');\n const [c, m, y, k] = args;\n const alpha = args.length > 4 ? args[4] : 1;\n if (k === 1) return [0, 0, 0, alpha];\n return [\n c >= 1 ? 0 : 255 * (1 - c) * (1 - k), // r\n m >= 1 ? 0 : 255 * (1 - m) * (1 - k), // g\n y >= 1 ? 0 : 255 * (1 - y) * (1 - k), // b\n alpha\n ];\n};\n\nexport default cmyk2rgb;\n","import { unpack } from '../../utils/index.js';\nconst { max } = Math;\n\nconst rgb2cmyk = (...args) => {\n let [r, g, b] = unpack(args, 'rgb');\n r = r / 255;\n g = g / 255;\n b = b / 255;\n const k = 1 - max(r, max(g, b));\n const f = k < 1 ? 1 / (1 - k) : 0;\n const c = (1 - r - k) * f;\n const m = (1 - g - k) * f;\n const y = (1 - b - k) * f;\n return [c, m, y, k];\n};\n\nexport default rgb2cmyk;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { unpack, type } from '../../utils/index.js';\nimport cmyk2rgb from './cmyk2rgb.js';\nimport rgb2cmyk from './rgb2cmyk.js';\n\nColor.prototype.cmyk = function () {\n return rgb2cmyk(this._rgb);\n};\n\nchroma.cmyk = (...args) => new Color(...args, 'cmyk');\n\ninput.format.cmyk = cmyk2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'cmyk');\n if (type(args) === 'array' && args.length === 4) {\n return 'cmyk';\n }\n }\n});\n","import { unpack, last } from '../../utils/index.js';\nconst rnd = (a) => Math.round(a * 100) / 100;\n\n/*\n * supported arguments:\n * - hsl2css(h,s,l)\n * - hsl2css(h,s,l,a)\n * - hsl2css([h,s,l], mode)\n * - hsl2css([h,s,l,a], mode)\n * - hsl2css({h,s,l,a}, mode)\n */\nconst hsl2css = (...args) => {\n const hsla = unpack(args, 'hsla');\n let mode = last(args) || 'lsa';\n hsla[0] = rnd(hsla[0] || 0);\n hsla[1] = rnd(hsla[1] * 100) + '%';\n hsla[2] = rnd(hsla[2] * 100) + '%';\n if (mode === 'hsla' || (hsla.length > 3 && hsla[3] < 1)) {\n hsla[3] = hsla.length > 3 ? hsla[3] : 1;\n mode = 'hsla';\n } else {\n hsla.length = 3;\n }\n return `${mode}(${hsla.join(',')})`;\n};\n\nexport default hsl2css;\n","import { unpack, min, max } from '../../utils/index.js';\n\n/*\n * supported arguments:\n * - rgb2hsl(r,g,b)\n * - rgb2hsl(r,g,b,a)\n * - rgb2hsl([r,g,b])\n * - rgb2hsl([r,g,b,a])\n * - rgb2hsl({r,g,b,a})\n */\nconst rgb2hsl = (...args) => {\n args = unpack(args, 'rgba');\n let [r, g, b] = args;\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n const minRgb = min(r, g, b);\n const maxRgb = max(r, g, b);\n\n const l = (maxRgb + minRgb) / 2;\n let s, h;\n\n if (maxRgb === minRgb) {\n s = 0;\n h = Number.NaN;\n } else {\n s =\n l < 0.5\n ? (maxRgb - minRgb) / (maxRgb + minRgb)\n : (maxRgb - minRgb) / (2 - maxRgb - minRgb);\n }\n\n if (r == maxRgb) h = (g - b) / (maxRgb - minRgb);\n else if (g == maxRgb) h = 2 + (b - r) / (maxRgb - minRgb);\n else if (b == maxRgb) h = 4 + (r - g) / (maxRgb - minRgb);\n\n h *= 60;\n if (h < 0) h += 360;\n if (args.length > 3 && args[3] !== undefined) return [h, s, l, args[3]];\n return [h, s, l];\n};\n\nexport default rgb2hsl;\n","import { unpack, last } from '../../utils/index.js';\nimport hsl2css from './hsl2css.js';\nimport rgb2hsl from '../hsl/rgb2hsl.js';\nconst { round } = Math;\n\n/*\n * supported arguments:\n * - rgb2css(r,g,b)\n * - rgb2css(r,g,b,a)\n * - rgb2css([r,g,b], mode)\n * - rgb2css([r,g,b,a], mode)\n * - rgb2css({r,g,b,a}, mode)\n */\nconst rgb2css = (...args) => {\n const rgba = unpack(args, 'rgba');\n let mode = last(args) || 'rgb';\n if (mode.substr(0, 3) == 'hsl') {\n return hsl2css(rgb2hsl(rgba), mode);\n }\n rgba[0] = round(rgba[0]);\n rgba[1] = round(rgba[1]);\n rgba[2] = round(rgba[2]);\n if (mode === 'rgba' || (rgba.length > 3 && rgba[3] < 1)) {\n rgba[3] = rgba.length > 3 ? rgba[3] : 1;\n mode = 'rgba';\n }\n return `${mode}(${rgba.slice(0, mode === 'rgb' ? 3 : 4).join(',')})`;\n};\n\nexport default rgb2css;\n","import { unpack } from '../../utils/index.js';\nconst { round } = Math;\n\nconst hsl2rgb = (...args) => {\n args = unpack(args, 'hsl');\n const [h, s, l] = args;\n let r, g, b;\n if (s === 0) {\n r = g = b = l * 255;\n } else {\n const t3 = [0, 0, 0];\n const c = [0, 0, 0];\n const t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const t1 = 2 * l - t2;\n const h_ = h / 360;\n t3[0] = h_ + 1 / 3;\n t3[1] = h_;\n t3[2] = h_ - 1 / 3;\n for (let i = 0; i < 3; i++) {\n if (t3[i] < 0) t3[i] += 1;\n if (t3[i] > 1) t3[i] -= 1;\n if (6 * t3[i] < 1) c[i] = t1 + (t2 - t1) * 6 * t3[i];\n else if (2 * t3[i] < 1) c[i] = t2;\n else if (3 * t3[i] < 2) c[i] = t1 + (t2 - t1) * (2 / 3 - t3[i]) * 6;\n else c[i] = t1;\n }\n [r, g, b] = [round(c[0] * 255), round(c[1] * 255), round(c[2] * 255)];\n }\n if (args.length > 3) {\n // keep alpha channel\n return [r, g, b, args[3]];\n }\n return [r, g, b, 1];\n};\n\nexport default hsl2rgb;\n","import hsl2rgb from '../hsl/hsl2rgb.js';\nimport input from '../input.js';\n\nconst RE_RGB = /^rgb\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*\\)$/;\nconst RE_RGBA =\n /^rgba\\(\\s*(-?\\d+),\\s*(-?\\d+)\\s*,\\s*(-?\\d+)\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\nconst RE_RGB_PCT =\n /^rgb\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\nconst RE_RGBA_PCT =\n /^rgba\\(\\s*(-?\\d+(?:\\.\\d+)?)%,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\nconst RE_HSL =\n /^hsl\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*\\)$/;\nconst RE_HSLA =\n /^hsla\\(\\s*(-?\\d+(?:\\.\\d+)?),\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*(-?\\d+(?:\\.\\d+)?)%\\s*,\\s*([01]|[01]?\\.\\d+)\\)$/;\n\nconst { round } = Math;\n\nconst css2rgb = (css) => {\n css = css.toLowerCase().trim();\n let m;\n\n if (input.format.named) {\n try {\n return input.format.named(css);\n // eslint-disable-next-line\n } catch (e) {}\n }\n\n // rgb(250,20,0)\n if ((m = css.match(RE_RGB))) {\n const rgb = m.slice(1, 4);\n for (let i = 0; i < 3; i++) {\n rgb[i] = +rgb[i];\n }\n rgb[3] = 1; // default alpha\n return rgb;\n }\n\n // rgba(250,20,0,0.4)\n if ((m = css.match(RE_RGBA))) {\n const rgb = m.slice(1, 5);\n for (let i = 0; i < 4; i++) {\n rgb[i] = +rgb[i];\n }\n return rgb;\n }\n\n // rgb(100%,0%,0%)\n if ((m = css.match(RE_RGB_PCT))) {\n const rgb = m.slice(1, 4);\n for (let i = 0; i < 3; i++) {\n rgb[i] = round(rgb[i] * 2.55);\n }\n rgb[3] = 1; // default alpha\n return rgb;\n }\n\n // rgba(100%,0%,0%,0.4)\n if ((m = css.match(RE_RGBA_PCT))) {\n const rgb = m.slice(1, 5);\n for (let i = 0; i < 3; i++) {\n rgb[i] = round(rgb[i] * 2.55);\n }\n rgb[3] = +rgb[3];\n return rgb;\n }\n\n // hsl(0,100%,50%)\n if ((m = css.match(RE_HSL))) {\n const hsl = m.slice(1, 4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n const rgb = hsl2rgb(hsl);\n rgb[3] = 1;\n return rgb;\n }\n\n // hsla(0,100%,50%,0.5)\n if ((m = css.match(RE_HSLA))) {\n const hsl = m.slice(1, 4);\n hsl[1] *= 0.01;\n hsl[2] *= 0.01;\n const rgb = hsl2rgb(hsl);\n rgb[3] = +m[4]; // default alpha = 1\n return rgb;\n }\n};\n\ncss2rgb.test = (s) => {\n return (\n RE_RGB.test(s) ||\n RE_RGBA.test(s) ||\n RE_RGB_PCT.test(s) ||\n RE_RGBA_PCT.test(s) ||\n RE_HSL.test(s) ||\n RE_HSLA.test(s)\n );\n};\n\nexport default css2rgb;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { type } from '../../utils/index.js';\n\nimport rgb2css from './rgb2css.js';\nimport css2rgb from './css2rgb.js';\n\nColor.prototype.css = function (mode) {\n return rgb2css(this._rgb, mode);\n};\n\nchroma.css = (...args) => new Color(...args, 'css');\n\ninput.format.css = css2rgb;\n\ninput.autodetect.push({\n p: 5,\n test: (h, ...rest) => {\n if (!rest.length && type(h) === 'string' && css2rgb.test(h)) {\n return 'css';\n }\n }\n});\n","import Color from '../../Color.js';\nimport chroma from '../../chroma.js';\nimport input from '../input.js';\nimport { unpack } from '../../utils/index.js';\n\ninput.format.gl = (...args) => {\n const rgb = unpack(args, 'rgba');\n rgb[0] *= 255;\n rgb[1] *= 255;\n rgb[2] *= 255;\n return rgb;\n};\n\nchroma.gl = (...args) => new Color(...args, 'gl');\n\nColor.prototype.gl = function () {\n const rgb = this._rgb;\n return [rgb[0] / 255, rgb[1] / 255, rgb[2] / 255, rgb[3]];\n};\n","import { unpack } from '../../utils/index.js';\nconst { floor } = Math;\n\n/*\n * this is basically just HSV with some minor tweaks\n *\n * hue.. [0..360]\n * chroma .. [0..1]\n * grayness .. [0..1]\n */\n\nconst hcg2rgb = (...args) => {\n args = unpack(args, 'hcg');\n let [h, c, _g] = args;\n let r, g, b;\n _g = _g * 255;\n const _c = c * 255;\n if (c === 0) {\n r = g = b = _g;\n } else {\n if (h === 360) h = 0;\n if (h > 360) h -= 360;\n if (h < 0) h += 360;\n h /= 60;\n const i = floor(h);\n const f = h - i;\n const p = _g * (1 - c);\n const q = p + _c * (1 - f);\n const t = p + _c * f;\n const v = p + _c;\n switch (i) {\n case 0:\n [r, g, b] = [v, t, p];\n break;\n case 1:\n [r, g, b] = [q, v, p];\n break;\n case 2:\n [r, g, b] = [p, v, t];\n break;\n case 3:\n [r, g, b] = [p, q, v];\n break;\n case 4:\n [r, g, b] = [t, p, v];\n break;\n case 5:\n [r, g, b] = [v, p, q];\n break;\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n};\n\nexport default hcg2rgb;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport hcg2rgb from './hcg2rgb.js';\nimport rgb2hcg from './rgb2hcg.js';\n\nColor.prototype.hcg = function () {\n return rgb2hcg(this._rgb);\n};\n\nchroma.hcg = (...args) => new Color(...args, 'hcg');\n\ninput.format.hcg = hcg2rgb;\n\ninput.autodetect.push({\n p: 1,\n test: (...args) => {\n args = unpack(args, 'hcg');\n if (type(args) === 'array' && args.length === 3) {\n return 'hcg';\n }\n }\n});\n","import { unpack, max, min } from '../../utils/index.js';\n\nconst rgb2hcg = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n const minRgb = min(r, g, b);\n const maxRgb = max(r, g, b);\n const delta = maxRgb - minRgb;\n const c = (delta * 100) / 255;\n const _g = (minRgb / (255 - delta)) * 100;\n let h;\n if (delta === 0) {\n h = Number.NaN;\n } else {\n if (r === maxRgb) h = (g - b) / delta;\n if (g === maxRgb) h = 2 + (b - r) / delta;\n if (b === maxRgb) h = 4 + (r - g) / delta;\n h *= 60;\n if (h < 0) h += 360;\n }\n return [h, c, _g];\n};\n\nexport default rgb2hcg;\n","const RE_HEX = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;\nconst RE_HEXA = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;\n\nconst hex2rgb = (hex) => {\n if (hex.match(RE_HEX)) {\n // remove optional leading #\n if (hex.length === 4 || hex.length === 7) {\n hex = hex.substr(1);\n }\n // expand short-notation to full six-digit\n if (hex.length === 3) {\n hex = hex.split('');\n hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\n }\n const u = parseInt(hex, 16);\n const r = u >> 16;\n const g = (u >> 8) & 0xff;\n const b = u & 0xff;\n return [r, g, b, 1];\n }\n\n // match rgba hex format, eg #FF000077\n if (hex.match(RE_HEXA)) {\n if (hex.length === 5 || hex.length === 9) {\n // remove optional leading #\n hex = hex.substr(1);\n }\n // expand short-notation to full eight-digit\n if (hex.length === 4) {\n hex = hex.split('');\n hex =\n hex[0] +\n hex[0] +\n hex[1] +\n hex[1] +\n hex[2] +\n hex[2] +\n hex[3] +\n hex[3];\n }\n const u = parseInt(hex, 16);\n const r = (u >> 24) & 0xff;\n const g = (u >> 16) & 0xff;\n const b = (u >> 8) & 0xff;\n const a = Math.round(((u & 0xff) / 0xff) * 100) / 100;\n return [r, g, b, a];\n }\n\n // we used to check for css colors here\n // if _input.css? and rgb = _input.css hex\n // return rgb\n\n throw new Error(`unknown hex color: ${hex}`);\n};\n\nexport default hex2rgb;\n","import { unpack, last } from '../../utils/index.js';\nconst { round } = Math;\n\nconst rgb2hex = (...args) => {\n let [r, g, b, a] = unpack(args, 'rgba');\n let mode = last(args) || 'auto';\n if (a === undefined) a = 1;\n if (mode === 'auto') {\n mode = a < 1 ? 'rgba' : 'rgb';\n }\n r = round(r);\n g = round(g);\n b = round(b);\n const u = (r << 16) | (g << 8) | b;\n let str = '000000' + u.toString(16); //#.toUpperCase();\n str = str.substr(str.length - 6);\n let hxa = '0' + round(a * 255).toString(16);\n hxa = hxa.substr(hxa.length - 2);\n switch (mode.toLowerCase()) {\n case 'rgba':\n return `#${str}${hxa}`;\n case 'argb':\n return `#${hxa}${str}`;\n default:\n return `#${str}`;\n }\n};\n\nexport default rgb2hex;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport { type } from '../../utils/index.js';\nimport input from '../input.js';\nimport hex2rgb from './hex2rgb.js';\nimport rgb2hex from './rgb2hex.js';\n\nColor.prototype.hex = function (mode) {\n return rgb2hex(this._rgb, mode);\n};\n\nchroma.hex = (...args) => new Color(...args, 'hex');\n\ninput.format.hex = hex2rgb;\ninput.autodetect.push({\n p: 4,\n test: (h, ...rest) => {\n if (\n !rest.length &&\n type(h) === 'string' &&\n [3, 4, 5, 6, 7, 8, 9].indexOf(h.length) >= 0\n ) {\n return 'hex';\n }\n }\n});\n","import { unpack, limit, TWOPI, PITHIRD } from '../../utils/index.js';\nconst { cos } = Math;\n\n/*\n * hue [0..360]\n * saturation [0..1]\n * intensity [0..1]\n */\nconst hsi2rgb = (...args) => {\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/hsi2rgb.cpp\n */\n args = unpack(args, 'hsi');\n let [h, s, i] = args;\n let r, g, b;\n\n if (isNaN(h)) h = 0;\n if (isNaN(s)) s = 0;\n // normalize hue\n if (h > 360) h -= 360;\n if (h < 0) h += 360;\n h /= 360;\n if (h < 1 / 3) {\n b = (1 - s) / 3;\n r = (1 + (s * cos(TWOPI * h)) / cos(PITHIRD - TWOPI * h)) / 3;\n g = 1 - (b + r);\n } else if (h < 2 / 3) {\n h -= 1 / 3;\n r = (1 - s) / 3;\n g = (1 + (s * cos(TWOPI * h)) / cos(PITHIRD - TWOPI * h)) / 3;\n b = 1 - (r + g);\n } else {\n h -= 2 / 3;\n g = (1 - s) / 3;\n b = (1 + (s * cos(TWOPI * h)) / cos(PITHIRD - TWOPI * h)) / 3;\n r = 1 - (g + b);\n }\n r = limit(i * r * 3);\n g = limit(i * g * 3);\n b = limit(i * b * 3);\n return [r * 255, g * 255, b * 255, args.length > 3 ? args[3] : 1];\n};\n\nexport default hsi2rgb;\n","import { unpack, TWOPI } from '../../utils/index.js';\nconst { min, sqrt, acos } = Math;\n\nconst rgb2hsi = (...args) => {\n /*\n borrowed from here:\n http://hummer.stanford.edu/museinfo/doc/examples/humdrum/keyscape2/rgb2hsi.cpp\n */\n let [r, g, b] = unpack(args, 'rgb');\n r /= 255;\n g /= 255;\n b /= 255;\n let h;\n const min_ = min(r, g, b);\n const i = (r + g + b) / 3;\n const s = i > 0 ? 1 - min_ / i : 0;\n if (s === 0) {\n h = NaN;\n } else {\n h = (r - g + (r - b)) / 2;\n h /= sqrt((r - g) * (r - g) + (r - b) * (g - b));\n h = acos(h);\n if (b > g) {\n h = TWOPI - h;\n }\n h /= TWOPI;\n }\n return [h * 360, s, i];\n};\n\nexport default rgb2hsi;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport hsi2rgb from './hsi2rgb.js';\nimport rgb2hsi from './rgb2hsi.js';\n\nColor.prototype.hsi = function () {\n return rgb2hsi(this._rgb);\n};\n\nchroma.hsi = (...args) => new Color(...args, 'hsi');\n\ninput.format.hsi = hsi2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'hsi');\n if (type(args) === 'array' && args.length === 3) {\n return 'hsi';\n }\n }\n});\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport hsl2rgb from './hsl2rgb.js';\nimport rgb2hsl from './rgb2hsl.js';\n\nColor.prototype.hsl = function () {\n return rgb2hsl(this._rgb);\n};\n\nchroma.hsl = (...args) => new Color(...args, 'hsl');\n\ninput.format.hsl = hsl2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'hsl');\n if (type(args) === 'array' && args.length === 3) {\n return 'hsl';\n }\n }\n});\n","import { unpack } from '../../utils/index.js';\nconst { floor } = Math;\n\nconst hsv2rgb = (...args) => {\n args = unpack(args, 'hsv');\n let [h, s, v] = args;\n let r, g, b;\n v *= 255;\n if (s === 0) {\n r = g = b = v;\n } else {\n if (h === 360) h = 0;\n if (h > 360) h -= 360;\n if (h < 0) h += 360;\n h /= 60;\n\n const i = floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - s * f);\n const t = v * (1 - s * (1 - f));\n\n switch (i) {\n case 0:\n [r, g, b] = [v, t, p];\n break;\n case 1:\n [r, g, b] = [q, v, p];\n break;\n case 2:\n [r, g, b] = [p, v, t];\n break;\n case 3:\n [r, g, b] = [p, q, v];\n break;\n case 4:\n [r, g, b] = [t, p, v];\n break;\n case 5:\n [r, g, b] = [v, p, q];\n break;\n }\n }\n return [r, g, b, args.length > 3 ? args[3] : 1];\n};\n\nexport default hsv2rgb;\n","import { unpack } from '../../utils/index.js';\nconst { min, max } = Math;\n\n/*\n * supported arguments:\n * - rgb2hsv(r,g,b)\n * - rgb2hsv([r,g,b])\n * - rgb2hsv({r,g,b})\n */\nconst rgb2hsl = (...args) => {\n args = unpack(args, 'rgb');\n let [r, g, b] = args;\n const min_ = min(r, g, b);\n const max_ = max(r, g, b);\n const delta = max_ - min_;\n let h, s, v;\n v = max_ / 255.0;\n if (max_ === 0) {\n h = Number.NaN;\n s = 0;\n } else {\n s = delta / max_;\n if (r === max_) h = (g - b) / delta;\n if (g === max_) h = 2 + (b - r) / delta;\n if (b === max_) h = 4 + (r - g) / delta;\n h *= 60;\n if (h < 0) h += 360;\n }\n return [h, s, v];\n};\n\nexport default rgb2hsl;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport hsv2rgb from './hsv2rgb.js';\nimport rgb2hsv from './rgb2hsv.js';\n\nColor.prototype.hsv = function () {\n return rgb2hsv(this._rgb);\n};\n\nchroma.hsv = (...args) => new Color(...args, 'hsv');\n\ninput.format.hsv = hsv2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'hsv');\n if (type(args) === 'array' && args.length === 3) {\n return 'hsv';\n }\n }\n});\n","export default {\n // Corresponds roughly to RGB brighter/darker\n Kn: 18,\n\n // D65 standard referent\n Xn: 0.95047,\n Yn: 1,\n Zn: 1.08883,\n\n t0: 0.137931034, // 4 / 29\n t1: 0.206896552, // 6 / 29\n t2: 0.12841855, // 3 * t1 * t1\n t3: 0.008856452 // t1 * t1 * t1\n};\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\nconst { pow } = Math;\n\n/*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\nconst lab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [l, a, b] = args;\n let x, y, z, r, g, b_;\n\n y = (l + 16) / 116;\n x = isNaN(a) ? y : y + a / 500;\n z = isNaN(b) ? y : y - b / 200;\n\n y = LAB_CONSTANTS.Yn * lab_xyz(y);\n x = LAB_CONSTANTS.Xn * lab_xyz(x);\n z = LAB_CONSTANTS.Zn * lab_xyz(z);\n\n r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z); // D65 -> sRGB\n g = xyz_rgb(-0.969266 * x + 1.8760108 * y + 0.041556 * z);\n b_ = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);\n\n return [r, g, b_, args.length > 3 ? args[3] : 1];\n};\n\nconst xyz_rgb = (r) => {\n return 255 * (r <= 0.00304 ? 12.92 * r : 1.055 * pow(r, 1 / 2.4) - 0.055);\n};\n\nconst lab_xyz = (t) => {\n return t > LAB_CONSTANTS.t1\n ? t * t * t\n : LAB_CONSTANTS.t2 * (t - LAB_CONSTANTS.t0);\n};\n\nexport default lab2rgb;\n","import LAB_CONSTANTS from './lab-constants.js';\nimport { unpack } from '../../utils/index.js';\nconst { pow } = Math;\n\nconst rgb2lab = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n const [x, y, z] = rgb2xyz(r, g, b);\n const l = 116 * y - 16;\n return [l < 0 ? 0 : l, 500 * (x - y), 200 * (y - z)];\n};\n\nconst rgb_xyz = (r) => {\n if ((r /= 255) <= 0.04045) return r / 12.92;\n return pow((r + 0.055) / 1.055, 2.4);\n};\n\nconst xyz_lab = (t) => {\n if (t > LAB_CONSTANTS.t3) return pow(t, 1 / 3);\n return t / LAB_CONSTANTS.t2 + LAB_CONSTANTS.t0;\n};\n\nconst rgb2xyz = (r, g, b) => {\n r = rgb_xyz(r);\n g = rgb_xyz(g);\n b = rgb_xyz(b);\n const x = xyz_lab(\n (0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS.Xn\n );\n const y = xyz_lab(\n (0.2126729 * r + 0.7151522 * g + 0.072175 * b) / LAB_CONSTANTS.Yn\n );\n const z = xyz_lab(\n (0.0193339 * r + 0.119192 * g + 0.9503041 * b) / LAB_CONSTANTS.Zn\n );\n return [x, y, z];\n};\n\nexport default rgb2lab;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport lab2rgb from './lab2rgb.js';\nimport rgb2lab from './rgb2lab.js';\n\nColor.prototype.lab = function () {\n return rgb2lab(this._rgb);\n};\n\nchroma.lab = (...args) => new Color(...args, 'lab');\n\ninput.format.lab = lab2rgb;\n\ninput.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, 'lab');\n if (type(args) === 'array' && args.length === 3) {\n return 'lab';\n }\n }\n});\n","import { unpack, DEG2RAD } from '../../utils/index.js';\nconst { sin, cos } = Math;\n\nconst lch2lab = (...args) => {\n /*\n Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel.\n These formulas were invented by David Dalrymple to obtain maximum contrast without going\n out of gamut if the parameters are in the range 0-1.\n\n A saturation multiplier was added by Gregor Aisch\n */\n let [l, c, h] = unpack(args, 'lch');\n if (isNaN(h)) h = 0;\n h = h * DEG2RAD;\n return [l, cos(h) * c, sin(h) * c];\n};\n\nexport default lch2lab;\n","import { unpack } from '../../utils/index.js';\nimport lch2lab from './lch2lab.js';\nimport lab2rgb from '../lab/lab2rgb.js';\n\nconst lch2rgb = (...args) => {\n args = unpack(args, 'lch');\n const [l, c, h] = args;\n const [L, a, b_] = lch2lab(l, c, h);\n const [r, g, b] = lab2rgb(L, a, b_);\n return [r, g, b, args.length > 3 ? args[3] : 1];\n};\n\nexport default lch2rgb;\n","import { unpack, RAD2DEG } from '../../utils/index.js';\nconst { sqrt, atan2, round } = Math;\n\nconst lab2lch = (...args) => {\n const [l, a, b] = unpack(args, 'lab');\n const c = sqrt(a * a + b * b);\n let h = (atan2(b, a) * RAD2DEG + 360) % 360;\n if (round(c * 10000) === 0) h = Number.NaN;\n return [l, c, h];\n};\n\nexport default lab2lch;\n","import { unpack } from '../../utils/index.js';\nimport rgb2lab from '../lab/rgb2lab.js';\nimport lab2lch from './lab2lch.js';\n\nconst rgb2lch = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2lab(r, g, b);\n return lab2lch(l, a, b_);\n};\n\nexport default rgb2lch;\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport lch2rgb from './lch2rgb.js';\nimport hcl2rgb from './hcl2rgb.js';\nimport rgb2lch from './rgb2lch.js';\n\nColor.prototype.lch = function () {\n return rgb2lch(this._rgb);\n};\nColor.prototype.hcl = function () {\n return rgb2lch(this._rgb).reverse();\n};\n\nchroma.lch = (...args) => new Color(...args, 'lch');\nchroma.hcl = (...args) => new Color(...args, 'hcl');\n\ninput.format.lch = lch2rgb;\ninput.format.hcl = hcl2rgb;\n['lch', 'hcl'].forEach((m) =>\n input.autodetect.push({\n p: 2,\n test: (...args) => {\n args = unpack(args, m);\n if (type(args) === 'array' && args.length === 3) {\n return m;\n }\n }\n })\n);\n","import { unpack } from '../../utils/index.js';\nimport lch2rgb from './lch2rgb.js';\n\nconst hcl2rgb = (...args) => {\n const hcl = unpack(args, 'hcl').reverse();\n return lch2rgb(...hcl);\n};\n\nexport default hcl2rgb;\n","/**\n\tX11 color names\n\n\thttp://www.w3.org/TR/css3-color/#svg-color\n*/\n\nconst w3cx11 = {\n aliceblue: '#f0f8ff',\n antiquewhite: '#faebd7',\n aqua: '#00ffff',\n aquamarine: '#7fffd4',\n azure: '#f0ffff',\n beige: '#f5f5dc',\n bisque: '#ffe4c4',\n black: '#000000',\n blanchedalmond: '#ffebcd',\n blue: '#0000ff',\n blueviolet: '#8a2be2',\n brown: '#a52a2a',\n burlywood: '#deb887',\n cadetblue: '#5f9ea0',\n chartreuse: '#7fff00',\n chocolate: '#d2691e',\n coral: '#ff7f50',\n cornflowerblue: '#6495ed',\n cornsilk: '#fff8dc',\n crimson: '#dc143c',\n cyan: '#00ffff',\n darkblue: '#00008b',\n darkcyan: '#008b8b',\n darkgoldenrod: '#b8860b',\n darkgray: '#a9a9a9',\n darkgreen: '#006400',\n darkgrey: '#a9a9a9',\n darkkhaki: '#bdb76b',\n darkmagenta: '#8b008b',\n darkolivegreen: '#556b2f',\n darkorange: '#ff8c00',\n darkorchid: '#9932cc',\n darkred: '#8b0000',\n darksalmon: '#e9967a',\n darkseagreen: '#8fbc8f',\n darkslateblue: '#483d8b',\n darkslategray: '#2f4f4f',\n darkslategrey: '#2f4f4f',\n darkturquoise: '#00ced1',\n darkviolet: '#9400d3',\n deeppink: '#ff1493',\n deepskyblue: '#00bfff',\n dimgray: '#696969',\n dimgrey: '#696969',\n dodgerblue: '#1e90ff',\n firebrick: '#b22222',\n floralwhite: '#fffaf0',\n forestgreen: '#228b22',\n fuchsia: '#ff00ff',\n gainsboro: '#dcdcdc',\n ghostwhite: '#f8f8ff',\n gold: '#ffd700',\n goldenrod: '#daa520',\n gray: '#808080',\n green: '#008000',\n greenyellow: '#adff2f',\n grey: '#808080',\n honeydew: '#f0fff0',\n hotpink: '#ff69b4',\n indianred: '#cd5c5c',\n indigo: '#4b0082',\n ivory: '#fffff0',\n khaki: '#f0e68c',\n laserlemon: '#ffff54',\n lavender: '#e6e6fa',\n lavenderblush: '#fff0f5',\n lawngreen: '#7cfc00',\n lemonchiffon: '#fffacd',\n lightblue: '#add8e6',\n lightcoral: '#f08080',\n lightcyan: '#e0ffff',\n lightgoldenrod: '#fafad2',\n lightgoldenrodyellow: '#fafad2',\n lightgray: '#d3d3d3',\n lightgreen: '#90ee90',\n lightgrey: '#d3d3d3',\n lightpink: '#ffb6c1',\n lightsalmon: '#ffa07a',\n lightseagreen: '#20b2aa',\n lightskyblue: '#87cefa',\n lightslategray: '#778899',\n lightslategrey: '#778899',\n lightsteelblue: '#b0c4de',\n lightyellow: '#ffffe0',\n lime: '#00ff00',\n limegreen: '#32cd32',\n linen: '#faf0e6',\n magenta: '#ff00ff',\n maroon: '#800000',\n maroon2: '#7f0000',\n maroon3: '#b03060',\n mediumaquamarine: '#66cdaa',\n mediumblue: '#0000cd',\n mediumorchid: '#ba55d3',\n mediumpurple: '#9370db',\n mediumseagreen: '#3cb371',\n mediumslateblue: '#7b68ee',\n mediumspringgreen: '#00fa9a',\n mediumturquoise: '#48d1cc',\n mediumvioletred: '#c71585',\n midnightblue: '#191970',\n mintcream: '#f5fffa',\n mistyrose: '#ffe4e1',\n moccasin: '#ffe4b5',\n navajowhite: '#ffdead',\n navy: '#000080',\n oldlace: '#fdf5e6',\n olive: '#808000',\n olivedrab: '#6b8e23',\n orange: '#ffa500',\n orangered: '#ff4500',\n orchid: '#da70d6',\n palegoldenrod: '#eee8aa',\n palegreen: '#98fb98',\n paleturquoise: '#afeeee',\n palevioletred: '#db7093',\n papayawhip: '#ffefd5',\n peachpuff: '#ffdab9',\n peru: '#cd853f',\n pink: '#ffc0cb',\n plum: '#dda0dd',\n powderblue: '#b0e0e6',\n purple: '#800080',\n purple2: '#7f007f',\n purple3: '#a020f0',\n rebeccapurple: '#663399',\n red: '#ff0000',\n rosybrown: '#bc8f8f',\n royalblue: '#4169e1',\n saddlebrown: '#8b4513',\n salmon: '#fa8072',\n sandybrown: '#f4a460',\n seagreen: '#2e8b57',\n seashell: '#fff5ee',\n sienna: '#a0522d',\n silver: '#c0c0c0',\n skyblue: '#87ceeb',\n slateblue: '#6a5acd',\n slategray: '#708090',\n slategrey: '#708090',\n snow: '#fffafa',\n springgreen: '#00ff7f',\n steelblue: '#4682b4',\n tan: '#d2b48c',\n teal: '#008080',\n thistle: '#d8bfd8',\n tomato: '#ff6347',\n turquoise: '#40e0d0',\n violet: '#ee82ee',\n wheat: '#f5deb3',\n white: '#ffffff',\n whitesmoke: '#f5f5f5',\n yellow: '#ffff00',\n yellowgreen: '#9acd32'\n};\n\nexport default w3cx11;\n","import Color from '../../Color.js';\nimport input from '../input.js';\nimport { type } from '../../utils/index.js';\n\nimport w3cx11 from '../../colors/w3cx11.js';\nimport hex2rgb from '../hex/hex2rgb.js';\nimport rgb2hex from '../hex/rgb2hex.js';\n\nColor.prototype.name = function () {\n const hex = rgb2hex(this._rgb, 'rgb');\n for (let n of Object.keys(w3cx11)) {\n if (w3cx11[n] === hex) return n.toLowerCase();\n }\n return hex;\n};\n\ninput.format.named = (name) => {\n name = name.toLowerCase();\n if (w3cx11[name]) return hex2rgb(w3cx11[name]);\n throw new Error('unknown color name: ' + name);\n};\n\ninput.autodetect.push({\n p: 5,\n test: (h, ...rest) => {\n if (!rest.length && type(h) === 'string' && w3cx11[h.toLowerCase()]) {\n return 'named';\n }\n }\n});\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { type } from '../../utils/index.js';\nimport num2rgb from './num2rgb.js';\nimport rgb2num from './rgb2num.js';\n\nColor.prototype.num = function () {\n return rgb2num(this._rgb);\n};\n\nchroma.num = (...args) => new Color(...args, 'num');\n\ninput.format.num = num2rgb;\n\ninput.autodetect.push({\n p: 5,\n test: (...args) => {\n if (\n args.length === 1 &&\n type(args[0]) === 'number' &&\n args[0] >= 0 &&\n args[0] <= 0xffffff\n ) {\n return 'num';\n }\n }\n});\n","import { unpack } from '../../utils/index.js';\n\nconst rgb2num = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n return (r << 16) + (g << 8) + b;\n};\n\nexport default rgb2num;\n","import { type } from '../../utils/index.js';\n\nconst num2rgb = (num) => {\n if (type(num) == 'number' && num >= 0 && num <= 0xffffff) {\n const r = num >> 16;\n const g = (num >> 8) & 0xff;\n const b = num & 0xff;\n return [r, g, b, 1];\n }\n throw new Error('unknown num color: ' + num);\n};\n\nexport default num2rgb;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport { unpack, type } from '../../utils/index.js';\nconst { round } = Math;\n\nColor.prototype.rgb = function (rnd = true) {\n if (rnd === false) return this._rgb.slice(0, 3);\n return this._rgb.slice(0, 3).map(round);\n};\n\nColor.prototype.rgba = function (rnd = true) {\n return this._rgb.slice(0, 4).map((v, i) => {\n return i < 3 ? (rnd === false ? v : round(v)) : v;\n });\n};\n\nchroma.rgb = (...args) => new Color(...args, 'rgb');\n\ninput.format.rgb = (...args) => {\n const rgba = unpack(args, 'rgba');\n if (rgba[3] === undefined) rgba[3] = 1;\n return rgba;\n};\n\ninput.autodetect.push({\n p: 3,\n test: (...args) => {\n args = unpack(args, 'rgba');\n if (\n type(args) === 'array' &&\n (args.length === 3 ||\n (args.length === 4 &&\n type(args[3]) == 'number' &&\n args[3] >= 0 &&\n args[3] <= 1))\n ) {\n return 'rgb';\n }\n }\n});\n","/*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n */\n\nconst { log } = Math;\n\nconst temperature2rgb = (kelvin) => {\n const temp = kelvin / 100;\n let r, g, b;\n if (temp < 66) {\n r = 255;\n g =\n temp < 6\n ? 0\n : -155.25485562709179 -\n 0.44596950469579133 * (g = temp - 2) +\n 104.49216199393888 * log(g);\n b =\n temp < 20\n ? 0\n : -254.76935184120902 +\n 0.8274096064007395 * (b = temp - 10) +\n 115.67994401066147 * log(b);\n } else {\n r =\n 351.97690566805693 +\n 0.114206453784165 * (r = temp - 55) -\n 40.25366309332127 * log(r);\n g =\n 325.4494125711974 +\n 0.07943456536662342 * (g = temp - 50) -\n 28.0852963507957 * log(g);\n b = 255;\n }\n return [r, g, b, 1];\n};\n\nexport default temperature2rgb;\n","/*\n * Based on implementation by Neil Bartlett\n * https://github.com/neilbartlett/color-temperature\n **/\n\nimport temperature2rgb from './temperature2rgb.js';\nimport { unpack } from '../../utils/index.js';\nconst { round } = Math;\n\nconst rgb2temperature = (...args) => {\n const rgb = unpack(args, 'rgb');\n const r = rgb[0],\n b = rgb[2];\n let minTemp = 1000;\n let maxTemp = 40000;\n const eps = 0.4;\n let temp;\n while (maxTemp - minTemp > eps) {\n temp = (maxTemp + minTemp) * 0.5;\n const rgb = temperature2rgb(temp);\n if (rgb[2] / rgb[0] >= b / r) {\n maxTemp = temp;\n } else {\n minTemp = temp;\n }\n }\n return round(temp);\n};\n\nexport default rgb2temperature;\n","import chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport temperature2rgb from './temperature2rgb.js';\nimport rgb2temperature from './rgb2temperature.js';\n\nColor.prototype.temp =\n Color.prototype.kelvin =\n Color.prototype.temperature =\n function () {\n return rgb2temperature(this._rgb);\n };\n\nchroma.temp =\n chroma.kelvin =\n chroma.temperature =\n (...args) => new Color(...args, 'temp');\n\ninput.format.temp =\n input.format.kelvin =\n input.format.temperature =\n temperature2rgb;\n","import { unpack } from '../../utils/index.js';\nconst { pow, sign } = Math;\n\n/*\n * L* [0..100]\n * a [-100..100]\n * b [-100..100]\n */\nconst oklab2rgb = (...args) => {\n args = unpack(args, 'lab');\n const [L, a, b] = args;\n\n const l = pow(L + 0.3963377774 * a + 0.2158037573 * b, 3);\n const m = pow(L - 0.1055613458 * a - 0.0638541728 * b, 3);\n const s = pow(L - 0.0894841775 * a - 1.291485548 * b, 3);\n\n return [\n 255 * lrgb2rgb(+4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),\n 255 * lrgb2rgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),\n 255 * lrgb2rgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),\n args.length > 3 ? args[3] : 1\n ];\n};\n\nexport default oklab2rgb;\n\nfunction lrgb2rgb(c) {\n const abs = Math.abs(c);\n if (abs > 0.0031308) {\n return (sign(c) || 1) * (1.055 * pow(abs, 1 / 2.4) - 0.055);\n }\n return c * 12.92;\n}\n","import { unpack } from '../../utils/index.js';\nconst { cbrt, pow, sign } = Math;\n\nconst rgb2oklab = (...args) => {\n // OKLab color space implementation taken from\n // https://bottosson.github.io/posts/oklab/\n const [r, g, b] = unpack(args, 'rgb');\n const [lr, lg, lb] = [\n rgb2lrgb(r / 255),\n rgb2lrgb(g / 255),\n rgb2lrgb(b / 255)\n ];\n const l = cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);\n const m = cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);\n const s = cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);\n\n return [\n 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s\n ];\n};\n\nexport default rgb2oklab;\n\nfunction rgb2lrgb(c) {\n const abs = Math.abs(c);\n if (abs < 0.04045) {\n return c / 12.92;\n }\n return (sign(c) || 1) * pow((abs + 0.055) / 1.055, 2.4);\n}\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport oklab2rgb from './oklab2rgb.js';\nimport rgb2oklab from './rgb2oklab.js';\n\nColor.prototype.oklab = function () {\n return rgb2oklab(this._rgb);\n};\n\nchroma.oklab = (...args) => new Color(...args, 'oklab');\n\ninput.format.oklab = oklab2rgb;\n\ninput.autodetect.push({\n p: 3,\n test: (...args) => {\n args = unpack(args, 'oklab');\n if (type(args) === 'array' && args.length === 3) {\n return 'oklab';\n }\n }\n});\n","import { unpack, type } from '../../utils/index.js';\nimport chroma from '../../chroma.js';\nimport Color from '../../Color.js';\nimport input from '../input.js';\nimport oklch2rgb from './oklch2rgb.js';\nimport rgb2oklch from './rgb2oklch.js';\n\nColor.prototype.oklch = function () {\n return rgb2oklch(this._rgb);\n};\n\nchroma.oklch = (...args) => new Color(...args, 'oklch');\n\ninput.format.oklch = oklch2rgb;\n\ninput.autodetect.push({\n p: 3,\n test: (...args) => {\n args = unpack(args, 'oklch');\n if (type(args) === 'array' && args.length === 3) {\n return 'oklch';\n }\n }\n});\n","import { unpack } from '../../utils/index.js';\nimport rgb2oklab from '../oklab/rgb2oklab.js';\nimport lab2lch from '../lch/lab2lch.js';\n\nconst rgb2oklch = (...args) => {\n const [r, g, b] = unpack(args, 'rgb');\n const [l, a, b_] = rgb2oklab(r, g, b);\n return lab2lch(l, a, b_);\n};\n\nexport default rgb2oklch;\n","import { unpack } from '../../utils/index.js';\nimport lch2lab from '../lch/lch2lab.js';\nimport oklab2rgb from '../oklab/oklab2rgb.js';\n\nconst oklch2rgb = (...args) => {\n args = unpack(args, 'lch');\n const [l, c, h] = args;\n const [L, a, b_] = lch2lab(l, c, h);\n const [r, g, b] = oklab2rgb(L, a, b_);\n return [r, g, b, args.length > 3 ? args[3] : 1];\n};\n\nexport default oklch2rgb;\n","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\n\nColor.prototype.alpha = function (a, mutate = false) {\n if (a !== undefined && type(a) === 'number') {\n if (mutate) {\n this._rgb[3] = a;\n return this;\n }\n return new Color([this._rgb[0], this._rgb[1], this._rgb[2], a], 'rgb');\n }\n return this._rgb[3];\n};\n","import Color from '../Color.js';\n\nColor.prototype.clipped = function () {\n return this._rgb._clipped || false;\n};\n","import '../io/lab/index.js';\nimport Color from '../Color.js';\nimport LAB_CONSTANTS from '../io/lab/lab-constants.js';\n\nColor.prototype.darken = function (amount = 1) {\n const me = this;\n const lab = me.lab();\n lab[0] -= LAB_CONSTANTS.Kn * amount;\n return new Color(lab, 'lab').alpha(me.alpha(), true);\n};\n\nColor.prototype.brighten = function (amount = 1) {\n return this.darken(-amount);\n};\n\nColor.prototype.darker = Color.prototype.darken;\nColor.prototype.brighter = Color.prototype.brighten;\n","import Color from '../Color.js';\n\nColor.prototype.get = function (mc) {\n const [mode, channel] = mc.split('.');\n const src = this[mode]();\n if (channel) {\n const i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) return src[i];\n throw new Error(`unknown channel ${channel} in mode ${mode}`);\n } else {\n return src;\n }\n};\n","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\nconst { pow } = Math;\n\nconst EPS = 1e-7;\nconst MAX_ITER = 20;\n\nColor.prototype.luminance = function (lum, mode = 'rgb') {\n if (lum !== undefined && type(lum) === 'number') {\n if (lum === 0) {\n // return pure black\n return new Color([0, 0, 0, this._rgb[3]], 'rgb');\n }\n if (lum === 1) {\n // return pure white\n return new Color([255, 255, 255, this._rgb[3]], 'rgb');\n }\n // compute new color using...\n let cur_lum = this.luminance();\n let max_iter = MAX_ITER;\n\n const test = (low, high) => {\n const mid = low.interpolate(high, 0.5, mode);\n const lm = mid.luminance();\n if (Math.abs(lum - lm) < EPS || !max_iter--) {\n // close enough\n return mid;\n }\n return lm > lum ? test(low, mid) : test(mid, high);\n };\n\n const rgb = (\n cur_lum > lum\n ? test(new Color([0, 0, 0]), this)\n : test(this, new Color([255, 255, 255]))\n ).rgb();\n return new Color([...rgb, this._rgb[3]]);\n }\n return rgb2luminance(...this._rgb.slice(0, 3));\n};\n\nconst rgb2luminance = (r, g, b) => {\n // relative luminance\n // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n r = luminance_x(r);\n g = luminance_x(g);\n b = luminance_x(b);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n};\n\nconst luminance_x = (x) => {\n x /= 255;\n return x <= 0.03928 ? x / 12.92 : pow((x + 0.055) / 1.055, 2.4);\n};\n","export default {};\n","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\nimport interpolator from '../interpolator/index.js';\n\nexport default (col1, col2, f = 0.5, ...rest) => {\n let mode = rest[0] || 'lrgb';\n if (!interpolator[mode] && !rest.length) {\n // fall back to the first supported mode\n mode = Object.keys(interpolator)[0];\n }\n if (!interpolator[mode]) {\n throw new Error(`interpolation mode ${mode} is not defined`);\n }\n if (type(col1) !== 'object') col1 = new Color(col1);\n if (type(col2) !== 'object') col2 = new Color(col2);\n return interpolator[mode](col1, col2, f).alpha(\n col1.alpha() + f * (col2.alpha() - col1.alpha())\n );\n};\n","import Color from '../Color.js';\nimport mix from '../generator/mix.js';\n\nColor.prototype.mix = Color.prototype.interpolate = function (\n col2,\n f = 0.5,\n ...rest\n) {\n return mix(this, col2, f, ...rest);\n};\n","import Color from '../Color.js';\n\nColor.prototype.premultiply = function (mutate = false) {\n const rgb = this._rgb;\n const a = rgb[3];\n if (mutate) {\n this._rgb = [rgb[0] * a, rgb[1] * a, rgb[2] * a, a];\n return this;\n } else {\n return new Color([rgb[0] * a, rgb[1] * a, rgb[2] * a, a], 'rgb');\n }\n};\n","import '../io/lch/index.js';\nimport Color from '../Color.js';\nimport LAB_CONSTANTS from '../io/lab/lab-constants.js';\n\nColor.prototype.saturate = function (amount = 1) {\n const me = this;\n const lch = me.lch();\n lch[1] += LAB_CONSTANTS.Kn * amount;\n if (lch[1] < 0) lch[1] = 0;\n return new Color(lch, 'lch').alpha(me.alpha(), true);\n};\n\nColor.prototype.desaturate = function (amount = 1) {\n return this.saturate(-amount);\n};\n","import Color from '../Color.js';\nimport { type } from '../utils/index.js';\n\nColor.prototype.set = function (mc, value, mutate = false) {\n const [mode, channel] = mc.split('.');\n const src = this[mode]();\n if (channel) {\n const i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);\n if (i > -1) {\n if (type(value) == 'string') {\n switch (value.charAt(0)) {\n case '+':\n src[i] += +value;\n break;\n case '-':\n src[i] += +value;\n break;\n case '*':\n src[i] *= +value.substr(1);\n break;\n case '/':\n src[i] /= +value.substr(1);\n break;\n default:\n src[i] = +value;\n }\n } else if (type(value) === 'number') {\n src[i] = value;\n } else {\n throw new Error(`unsupported value for Color.set`);\n }\n const out = new Color(src, mode);\n if (mutate) {\n this._rgb = out._rgb;\n return this;\n }\n return out;\n }\n throw new Error(`unknown channel ${channel} in mode ${mode}`);\n } else {\n return src;\n }\n};\n","import '../io/lab/index.js';\nimport Color from '../Color.js';\nimport mix from '../generator/mix.js';\n\nColor.prototype.tint = function (f = 0.5, ...rest) {\n return mix(this, 'white', f, ...rest);\n};\n\nColor.prototype.shade = function (f = 0.5, ...rest) {\n return mix(this, 'black', f, ...rest);\n};\n","import Color from '../Color.js';\nimport index from './index.js';\n\nconst rgb = (col1, col2, f) => {\n const xyz0 = col1._rgb;\n const xyz1 = col2._rgb;\n return new Color(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'rgb'\n );\n};\n\n// register interpolator\nindex.rgb = rgb;\n\nexport default rgb;\n","import Color from '../Color.js';\nconst { sqrt, pow } = Math;\nimport index from './index.js';\n\nconst lrgb = (col1, col2, f) => {\n const [x1, y1, z1] = col1._rgb;\n const [x2, y2, z2] = col2._rgb;\n return new Color(\n sqrt(pow(x1, 2) * (1 - f) + pow(x2, 2) * f),\n sqrt(pow(y1, 2) * (1 - f) + pow(y2, 2) * f),\n sqrt(pow(z1, 2) * (1 - f) + pow(z2, 2) * f),\n 'rgb'\n );\n};\n\n// register interpolator\nindex.lrgb = lrgb;\n\nexport default lrgb;\n","import '../io/lab/index.js';\nimport index from './index.js';\nimport Color from '../Color.js';\n\nconst lab = (col1, col2, f) => {\n const xyz0 = col1.lab();\n const xyz1 = col2.lab();\n return new Color(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'lab'\n );\n};\n\n// register interpolator\nindex.lab = lab;\n\nexport default lab;\n","import Color from '../Color.js';\n\nexport default (col1, col2, f, m) => {\n let xyz0, xyz1;\n if (m === 'hsl') {\n xyz0 = col1.hsl();\n xyz1 = col2.hsl();\n } else if (m === 'hsv') {\n xyz0 = col1.hsv();\n xyz1 = col2.hsv();\n } else if (m === 'hcg') {\n xyz0 = col1.hcg();\n xyz1 = col2.hcg();\n } else if (m === 'hsi') {\n xyz0 = col1.hsi();\n xyz1 = col2.hsi();\n } else if (m === 'lch' || m === 'hcl') {\n m = 'hcl';\n xyz0 = col1.hcl();\n xyz1 = col2.hcl();\n } else if (m === 'oklch') {\n xyz0 = col1.oklch().reverse();\n xyz1 = col2.oklch().reverse();\n }\n\n let hue0, hue1, sat0, sat1, lbv0, lbv1;\n if (m.substr(0, 1) === 'h' || m === 'oklch') {\n [hue0, sat0, lbv0] = xyz0;\n [hue1, sat1, lbv1] = xyz1;\n }\n\n let sat, hue, lbv, dh;\n\n if (!isNaN(hue0) && !isNaN(hue1)) {\n // both colors have hue\n if (hue1 > hue0 && hue1 - hue0 > 180) {\n dh = hue1 - (hue0 + 360);\n } else if (hue1 < hue0 && hue0 - hue1 > 180) {\n dh = hue1 + 360 - hue0;\n } else {\n dh = hue1 - hue0;\n }\n hue = hue0 + f * dh;\n } else if (!isNaN(hue0)) {\n hue = hue0;\n if ((lbv1 == 1 || lbv1 == 0) && m != 'hsv') sat = sat0;\n } else if (!isNaN(hue1)) {\n hue = hue1;\n if ((lbv0 == 1 || lbv0 == 0) && m != 'hsv') sat = sat1;\n } else {\n hue = Number.NaN;\n }\n\n if (sat === undefined) sat = sat0 + f * (sat1 - sat0);\n lbv = lbv0 + f * (lbv1 - lbv0);\n return m === 'oklch'\n ? new Color([lbv, sat, hue], m)\n : new Color([hue, sat, lbv], m);\n};\n","import '../io/lch/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst lch = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'lch');\n};\n\n// register interpolator\nindex.lch = lch;\nindex.hcl = lch;\n\nexport default lch;\n","import '../io/num/index.js';\nimport index from './index.js';\n\nimport Color from '../Color.js';\n\nconst num = (col1, col2, f) => {\n const c1 = col1.num();\n const c2 = col2.num();\n return new Color(c1 + f * (c2 - c1), 'num');\n};\n\n// register interpolator\nindex.num = num;\n\nexport default num;\n","import '../io/hcg/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst hcg = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hcg');\n};\n\n// register interpolator\nindex.hcg = hcg;\n\nexport default hcg;\n","import '../io/hsi/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst hsi = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsi');\n};\n\n// register interpolator\nindex.hsi = hsi;\n\nexport default hsi;\n","import '../io/hsl/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst hsl = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsl');\n};\n\n// register interpolator\nindex.hsl = hsl;\n\nexport default hsl;\n","import '../io/hsv/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst hsv = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'hsv');\n};\n\n// register interpolator\nindex.hsv = hsv;\n\nexport default hsv;\n","import '../io/oklab/index.js';\nimport index from './index.js';\nimport Color from '../Color.js';\n\nconst oklab = (col1, col2, f) => {\n const xyz0 = col1.oklab();\n const xyz1 = col2.oklab();\n return new Color(\n xyz0[0] + f * (xyz1[0] - xyz0[0]),\n xyz0[1] + f * (xyz1[1] - xyz0[1]),\n xyz0[2] + f * (xyz1[2] - xyz0[2]),\n 'oklab'\n );\n};\n\n// register interpolator\nindex.oklab = oklab;\n\nexport default oklab;\n","import '../io/lch/index.js';\nimport interpolate_hsx from './_hsx.js';\nimport index from './index.js';\n\nconst oklch = (col1, col2, f) => {\n return interpolate_hsx(col1, col2, f, 'oklch');\n};\n\n// register interpolator\nindex.oklch = oklch;\n\nexport default oklch;\n","import Color from '../Color.js';\nimport { clip_rgb } from '../utils/index.js';\n\nconst { pow, sqrt, PI, cos, sin, atan2 } = Math;\n\nexport default (colors, mode = 'lrgb', weights = null) => {\n const l = colors.length;\n if (!weights) weights = Array.from(new Array(l)).map(() => 1);\n // normalize weights\n const k =\n l /\n weights.reduce(function (a, b) {\n return a + b;\n });\n weights.forEach((w, i) => {\n weights[i] *= k;\n });\n // convert colors to Color objects\n colors = colors.map((c) => new Color(c));\n if (mode === 'lrgb') {\n return _average_lrgb(colors, weights);\n }\n const first = colors.shift();\n const xyz = first.get(mode);\n const cnt = [];\n let dx = 0;\n let dy = 0;\n // initial color\n for (let i = 0; i < xyz.length; i++) {\n xyz[i] = (xyz[i] || 0) * weights[0];\n cnt.push(isNaN(xyz[i]) ? 0 : weights[0]);\n if (mode.charAt(i) === 'h' && !isNaN(xyz[i])) {\n const A = (xyz[i] / 180) * PI;\n dx += cos(A) * weights[0];\n dy += sin(A) * weights[0];\n }\n }\n\n let alpha = first.alpha() * weights[0];\n colors.forEach((c, ci) => {\n const xyz2 = c.get(mode);\n alpha += c.alpha() * weights[ci + 1];\n for (let i = 0; i < xyz.length; i++) {\n if (!isNaN(xyz2[i])) {\n cnt[i] += weights[ci + 1];\n if (mode.charAt(i) === 'h') {\n const A = (xyz2[i] / 180) * PI;\n dx += cos(A) * weights[ci + 1];\n dy += sin(A) * weights[ci + 1];\n } else {\n xyz[i] += xyz2[i] * weights[ci + 1];\n }\n }\n }\n });\n\n for (let i = 0; i < xyz.length; i++) {\n if (mode.charAt(i) === 'h') {\n let A = (atan2(dy / cnt[i], dx / cnt[i]) / PI) * 180;\n while (A < 0) A += 360;\n while (A >= 360) A -= 360;\n xyz[i] = A;\n } else {\n xyz[i] = xyz[i] / cnt[i];\n }\n }\n alpha /= l;\n return new Color(xyz, mode).alpha(alpha > 0.99999 ? 1 : alpha, true);\n};\n\nconst _average_lrgb = (colors, weights) => {\n const l = colors.length;\n const xyz = [0, 0, 0, 0];\n for (let i = 0; i < colors.length; i++) {\n const col = colors[i];\n const f = weights[i] / l;\n const rgb = col._rgb;\n xyz[0] += pow(rgb[0], 2) * f;\n xyz[1] += pow(rgb[1], 2) * f;\n xyz[2] += pow(rgb[2], 2) * f;\n xyz[3] += rgb[3] * f;\n }\n xyz[0] = sqrt(xyz[0]);\n xyz[1] = sqrt(xyz[1]);\n xyz[2] = sqrt(xyz[2]);\n if (xyz[3] > 0.9999999) xyz[3] = 1;\n return new Color(clip_rgb(xyz));\n};\n","// minimal multi-purpose interface\n\n// @requires utils color analyze\nimport chroma from '../chroma.js';\nimport { limit, type } from '../utils/index.js';\n\nconst { pow } = Math;\n\nexport default function (colors) {\n // constructor\n let _mode = 'rgb';\n let _nacol = chroma('#ccc');\n let _spread = 0;\n // const _fixed = false;\n let _domain = [0, 1];\n let _pos = [];\n let _padding = [0, 0];\n let _classes = false;\n let _colors = [];\n let _out = false;\n let _min = 0;\n let _max = 1;\n let _correctLightness = false;\n let _colorCache = {};\n let _useCache = true;\n let _gamma = 1;\n\n // private methods\n\n const setColors = function (colors) {\n colors = colors || ['#fff', '#000'];\n if (\n colors &&\n type(colors) === 'string' &&\n chroma.brewer &&\n chroma.brewer[colors.toLowerCase()]\n ) {\n colors = chroma.brewer[colors.toLowerCase()];\n }\n if (type(colors) === 'array') {\n // handle single color\n if (colors.length === 1) {\n colors = [colors[0], colors[0]];\n }\n // make a copy of the colors\n colors = colors.slice(0);\n // convert to chroma classes\n for (let c = 0; c < colors.length; c++) {\n colors[c] = chroma(colors[c]);\n }\n // auto-fill color position\n _pos.length = 0;\n for (let c = 0; c < colors.length; c++) {\n _pos.push(c / (colors.length - 1));\n }\n }\n resetCache();\n return (_colors = colors);\n };\n\n const getClass = function (value) {\n if (_classes != null) {\n const n = _classes.length - 1;\n let i = 0;\n while (i < n && value >= _classes[i]) {\n i++;\n }\n return i - 1;\n }\n return 0;\n };\n\n let tMapLightness = (t) => t;\n let tMapDomain = (t) => t;\n\n // const classifyValue = function(value) {\n // let val = value;\n // if (_classes.length > 2) {\n // const n = _classes.length-1;\n // const i = getClass(value);\n // const minc = _classes[0] + ((_classes[1]-_classes[0]) * (0 + (_spread * 0.5))); // center of 1st class\n // const maxc = _classes[n-1] + ((_classes[n]-_classes[n-1]) * (1 - (_spread * 0.5))); // center of last class\n // val = _min + ((((_classes[i] + ((_classes[i+1] - _classes[i]) * 0.5)) - minc) / (maxc-minc)) * (_max - _min));\n // }\n // return val;\n // };\n\n const getColor = function (val, bypassMap) {\n let col, t;\n if (bypassMap == null) {\n bypassMap = false;\n }\n if (isNaN(val) || val === null) {\n return _nacol;\n }\n if (!bypassMap) {\n if (_classes && _classes.length > 2) {\n // find the class\n const c = getClass(val);\n t = c / (_classes.length - 2);\n } else if (_max !== _min) {\n // just interpolate between min/max\n t = (val - _min) / (_max - _min);\n } else {\n t = 1;\n }\n } else {\n t = val;\n }\n\n // domain map\n t = tMapDomain(t);\n\n if (!bypassMap) {\n t = tMapLightness(t); // lightness correction\n }\n\n if (_gamma !== 1) {\n t = pow(t, _gamma);\n }\n\n t = _padding[0] + t * (1 - _padding[0] - _padding[1]);\n\n t = limit(t, 0, 1);\n\n const k = Math.floor(t * 10000);\n\n if (_useCache && _colorCache[k]) {\n col = _colorCache[k];\n } else {\n if (type(_colors) === 'array') {\n //for i in [0.._pos.length-1]\n for (let i = 0; i < _pos.length; i++) {\n const p = _pos[i];\n if (t <= p) {\n col = _colors[i];\n break;\n }\n if (t >= p && i === _pos.length - 1) {\n col = _colors[i];\n break;\n }\n if (t > p && t < _pos[i + 1]) {\n t = (t - p) / (_pos[i + 1] - p);\n col = chroma.interpolate(\n _colors[i],\n _colors[i + 1],\n t,\n _mode\n );\n break;\n }\n }\n } else if (type(_colors) === 'function') {\n col = _colors(t);\n }\n if (_useCache) {\n _colorCache[k] = col;\n }\n }\n return col;\n };\n\n var resetCache = () => (_colorCache = {});\n\n setColors(colors);\n\n // public interface\n\n const f = function (v) {\n const c = chroma(getColor(v));\n if (_out && c[_out]) {\n return c[_out]();\n } else {\n return c;\n }\n };\n\n f.classes = function (classes) {\n if (classes != null) {\n if (type(classes) === 'array') {\n _classes = classes;\n _domain = [classes[0], classes[classes.length - 1]];\n } else {\n const d = chroma.analyze(_domain);\n if (classes === 0) {\n _classes = [d.min, d.max];\n } else {\n _classes = chroma.limits(d, 'e', classes);\n }\n }\n return f;\n }\n return _classes;\n };\n\n f.domain = function (domain) {\n if (!arguments.length) {\n return _domain;\n }\n _min = domain[0];\n _max = domain[domain.length - 1];\n _pos = [];\n const k = _colors.length;\n if (domain.length === k && _min !== _max) {\n // update positions\n for (let d of Array.from(domain)) {\n _pos.push((d - _min) / (_max - _min));\n }\n } else {\n for (let c = 0; c < k; c++) {\n _pos.push(c / (k - 1));\n }\n if (domain.length > 2) {\n // set domain map\n const tOut = domain.map((d, i) => i / (domain.length - 1));\n const tBreaks = domain.map((d) => (d - _min) / (_max - _min));\n if (!tBreaks.every((val, i) => tOut[i] === val)) {\n tMapDomain = (t) => {\n if (t <= 0 || t >= 1) return t;\n let i = 0;\n while (t >= tBreaks[i + 1]) i++;\n const f =\n (t - tBreaks[i]) / (tBreaks[i + 1] - tBreaks[i]);\n const out = tOut[i] + f * (tOut[i + 1] - tOut[i]);\n return out;\n };\n }\n }\n }\n _domain = [_min, _max];\n return f;\n };\n\n f.mode = function (_m) {\n if (!arguments.length) {\n return _mode;\n }\n _mode = _m;\n resetCache();\n return f;\n };\n\n f.range = function (colors, _pos) {\n setColors(colors, _pos);\n return f;\n };\n\n f.out = function (_o) {\n _out = _o;\n return f;\n };\n\n f.spread = function (val) {\n if (!arguments.length) {\n return _spread;\n }\n _spread = val;\n return f;\n };\n\n f.correctLightness = function (v) {\n if (v == null) {\n v = true;\n }\n _correctLightness = v;\n resetCache();\n if (_correctLightness) {\n tMapLightness = function (t) {\n const L0 = getColor(0, true).lab()[0];\n const L1 = getColor(1, true).lab()[0];\n const pol = L0 > L1;\n let L_actual = getColor(t, true).lab()[0];\n const L_ideal = L0 + (L1 - L0) * t;\n let L_diff = L_actual - L_ideal;\n let t0 = 0;\n let t1 = 1;\n let max_iter = 20;\n while (Math.abs(L_diff) > 1e-2 && max_iter-- > 0) {\n (function () {\n if (pol) {\n L_diff *= -1;\n }\n if (L_diff < 0) {\n t0 = t;\n t += (t1 - t) * 0.5;\n } else {\n t1 = t;\n t += (t0 - t) * 0.5;\n }\n L_actual = getColor(t, true).lab()[0];\n return (L_diff = L_actual - L_ideal);\n })();\n }\n return t;\n };\n } else {\n tMapLightness = (t) => t;\n }\n return f;\n };\n\n f.padding = function (p) {\n if (p != null) {\n if (type(p) === 'number') {\n p = [p, p];\n }\n _padding = p;\n return f;\n } else {\n return _padding;\n }\n };\n\n f.colors = function (numColors, out) {\n // If no arguments are given, return the original colors that were provided\n if (arguments.length < 2) {\n out = 'hex';\n }\n let result = [];\n\n if (arguments.length === 0) {\n result = _colors.slice(0);\n } else if (numColors === 1) {\n result = [f(0.5)];\n } else if (numColors > 1) {\n const dm = _domain[0];\n const dd = _domain[1] - dm;\n result = __range__(0, numColors, false).map((i) =>\n f(dm + (i / (numColors - 1)) * dd)\n );\n } else {\n // returns all colors based on the defined classes\n colors = [];\n let samples = [];\n if (_classes && _classes.length > 2) {\n for (\n let i = 1, end = _classes.length, asc = 1 <= end;\n asc ? i < end : i > end;\n asc ? i++ : i--\n ) {\n samples.push((_classes[i - 1] + _classes[i]) * 0.5);\n }\n } else {\n samples = _domain;\n }\n result = samples.map((v) => f(v));\n }\n\n if (chroma[out]) {\n result = result.map((c) => c[out]());\n }\n return result;\n };\n\n f.cache = function (c) {\n if (c != null) {\n _useCache = c;\n return f;\n } else {\n return _useCache;\n }\n };\n\n f.gamma = function (g) {\n if (g != null) {\n _gamma = g;\n return f;\n } else {\n return _gamma;\n }\n };\n\n f.nodata = function (d) {\n if (d != null) {\n _nacol = chroma(d);\n return f;\n } else {\n return _nacol;\n }\n };\n\n return f;\n}\n\nfunction __range__(left, right, inclusive) {\n let range = [];\n let ascending = left < right;\n let end = !inclusive ? right : ascending ? right + 1 : right - 1;\n for (let i = left; ascending ? i < end : i > end; ascending ? i++ : i--) {\n range.push(i);\n }\n return range;\n}\n","/*\n * interpolates between a set of colors uzing a bezier spline\n * blend mode formulas taken from https://web.archive.org/web/20180110014946/http://www.venture-ware.com/kevin/coding/lets-learn-math-photoshop-blend-modes/\n */\n\nimport '../io/rgb/index.js';\nimport chroma from '../chroma.js';\n\nconst blend = (bottom, top, mode) => {\n if (!blend[mode]) {\n throw new Error('unknown blend mode ' + mode);\n }\n return blend[mode](bottom, top);\n};\n\nconst blend_f = (f) => (bottom, top) => {\n const c0 = chroma(top).rgb();\n const c1 = chroma(bottom).rgb();\n return chroma.rgb(f(c0, c1));\n};\n\nconst each = (f) => (c0, c1) => {\n const out = [];\n out[0] = f(c0[0], c1[0]);\n out[1] = f(c0[1], c1[1]);\n out[2] = f(c0[2], c1[2]);\n return out;\n};\n\nconst normal = (a) => a;\nconst multiply = (a, b) => (a * b) / 255;\nconst darken = (a, b) => (a > b ? b : a);\nconst lighten = (a, b) => (a > b ? a : b);\nconst screen = (a, b) => 255 * (1 - (1 - a / 255) * (1 - b / 255));\nconst overlay = (a, b) =>\n b < 128 ? (2 * a * b) / 255 : 255 * (1 - 2 * (1 - a / 255) * (1 - b / 255));\nconst burn = (a, b) => 255 * (1 - (1 - b / 255) / (a / 255));\nconst dodge = (a, b) => {\n if (a === 255) return 255;\n a = (255 * (b / 255)) / (1 - a / 255);\n return a > 255 ? 255 : a;\n};\n\n// # add = (a,b) ->\n// # if (a + b > 255) then 255 else a + b\n\nblend.normal = blend_f(each(normal));\nblend.multiply = blend_f(each(multiply));\nblend.screen = blend_f(each(screen));\nblend.overlay = blend_f(each(overlay));\nblend.darken = blend_f(each(darken));\nblend.lighten = blend_f(each(lighten));\nblend.dodge = blend_f(each(dodge));\nblend.burn = blend_f(each(burn));\n// blend.add = blend_f(each(add));\n\nexport default blend;\n","// cubehelix interpolation\n// based on D.A. Green \"A colour scheme for the display of astronomical intensity images\"\n// http://astron-soc.in/bulletin/11June/289392011.pdf\nimport { type, clip_rgb, TWOPI } from '../utils/index.js';\nimport chroma from '../chroma.js';\nconst { pow, sin, cos } = Math;\n\nexport default function (\n start = 300,\n rotations = -1.5,\n hue = 1,\n gamma = 1,\n lightness = [0, 1]\n) {\n let dh = 0,\n dl;\n if (type(lightness) === 'array') {\n dl = lightness[1] - lightness[0];\n } else {\n dl = 0;\n lightness = [lightness, lightness];\n }\n const f = function (fract) {\n const a = TWOPI * ((start + 120) / 360 + rotations * fract);\n const l = pow(lightness[0] + dl * fract, gamma);\n const h = dh !== 0 ? hue[0] + fract * dh : hue;\n const amp = (h * l * (1 - l)) / 2;\n const cos_a = cos(a);\n const sin_a = sin(a);\n const r = l + amp * (-0.14861 * cos_a + 1.78277 * sin_a);\n const g = l + amp * (-0.29227 * cos_a - 0.90649 * sin_a);\n const b = l + amp * (+1.97294 * cos_a);\n return chroma(clip_rgb([r * 255, g * 255, b * 255, 1]));\n };\n f.start = function (s) {\n if (s == null) {\n return start;\n }\n start = s;\n return f;\n };\n f.rotations = function (r) {\n if (r == null) {\n return rotations;\n }\n rotations = r;\n return f;\n };\n f.gamma = function (g) {\n if (g == null) {\n return gamma;\n }\n gamma = g;\n return f;\n };\n f.hue = function (h) {\n if (h == null) {\n return hue;\n }\n hue = h;\n if (type(hue) === 'array') {\n dh = hue[1] - hue[0];\n if (dh === 0) {\n hue = hue[1];\n }\n } else {\n dh = 0;\n }\n return f;\n };\n f.lightness = function (h) {\n if (h == null) {\n return lightness;\n }\n if (type(h) === 'array') {\n lightness = h;\n dl = h[1] - h[0];\n } else {\n lightness = [h, h];\n dl = 0;\n }\n return f;\n };\n f.scale = () => chroma.scale(f);\n f.hue(hue);\n return f;\n}\n","import Color from '../Color.js';\nconst digits = '0123456789abcdef';\n\nconst { floor, random } = Math;\n\nexport default () => {\n let code = '#';\n for (let i = 0; i < 6; i++) {\n code += digits.charAt(floor(random() * 16));\n }\n return new Color(code, 'hex');\n};\n","import type from './type.js';\n\nconst { log, pow, floor, abs } = Math;\n\nexport function analyze(data, key = null) {\n const r = {\n min: Number.MAX_VALUE,\n max: Number.MAX_VALUE * -1,\n sum: 0,\n values: [],\n count: 0\n };\n if (type(data) === 'object') {\n data = Object.values(data);\n }\n data.forEach((val) => {\n if (key && type(val) === 'object') val = val[key];\n if (val !== undefined && val !== null && !isNaN(val)) {\n r.values.push(val);\n r.sum += val;\n if (val < r.min) r.min = val;\n if (val > r.max) r.max = val;\n r.count += 1;\n }\n });\n\n r.domain = [r.min, r.max];\n\n r.limits = (mode, num) => limits(r, mode, num);\n\n return r;\n}\n\nexport function limits(data, mode = 'equal', num = 7) {\n if (type(data) == 'array') {\n data = analyze(data);\n }\n const { min, max } = data;\n const values = data.values.sort((a, b) => a - b);\n\n if (num === 1) {\n return [min, max];\n }\n\n const limits = [];\n\n if (mode.substr(0, 1) === 'c') {\n // continuous\n limits.push(min);\n limits.push(max);\n }\n\n if (mode.substr(0, 1) === 'e') {\n // equal interval\n limits.push(min);\n for (let i = 1; i < num; i++) {\n limits.push(min + (i / num) * (max - min));\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'l') {\n // log scale\n if (min <= 0) {\n throw new Error(\n 'Logarithmic scales are only possible for values > 0'\n );\n }\n const min_log = Math.LOG10E * log(min);\n const max_log = Math.LOG10E * log(max);\n limits.push(min);\n for (let i = 1; i < num; i++) {\n limits.push(pow(10, min_log + (i / num) * (max_log - min_log)));\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'q') {\n // quantile scale\n limits.push(min);\n for (let i = 1; i < num; i++) {\n const p = ((values.length - 1) * i) / num;\n const pb = floor(p);\n if (pb === p) {\n limits.push(values[pb]);\n } else {\n // p > pb\n const pr = p - pb;\n limits.push(values[pb] * (1 - pr) + values[pb + 1] * pr);\n }\n }\n limits.push(max);\n } else if (mode.substr(0, 1) === 'k') {\n // k-means clustering\n /*\n implementation based on\n http://code.google.com/p/figue/source/browse/trunk/figue.js#336\n simplified for 1-d input values\n */\n let cluster;\n const n = values.length;\n const assignments = new Array(n);\n const clusterSizes = new Array(num);\n let repeat = true;\n let nb_iters = 0;\n let centroids = null;\n\n // get seed values\n centroids = [];\n centroids.push(min);\n for (let i = 1; i < num; i++) {\n centroids.push(min + (i / num) * (max - min));\n }\n centroids.push(max);\n\n while (repeat) {\n // assignment step\n for (let j = 0; j < num; j++) {\n clusterSizes[j] = 0;\n }\n for (let i = 0; i < n; i++) {\n const value = values[i];\n let mindist = Number.MAX_VALUE;\n let best;\n for (let j = 0; j < num; j++) {\n const dist = abs(centroids[j] - value);\n if (dist < mindist) {\n mindist = dist;\n best = j;\n }\n clusterSizes[best]++;\n assignments[i] = best;\n }\n }\n\n // update centroids step\n const newCentroids = new Array(num);\n for (let j = 0; j < num; j++) {\n newCentroids[j] = null;\n }\n for (let i = 0; i < n; i++) {\n cluster = assignments[i];\n if (newCentroids[cluster] === null) {\n newCentroids[cluster] = values[i];\n } else {\n newCentroids[cluster] += values[i];\n }\n }\n for (let j = 0; j < num; j++) {\n newCentroids[j] *= 1 / clusterSizes[j];\n }\n\n // check convergence\n repeat = false;\n for (let j = 0; j < num; j++) {\n if (newCentroids[j] !== centroids[j]) {\n repeat = true;\n break;\n }\n }\n\n centroids = newCentroids;\n nb_iters++;\n\n if (nb_iters > 200) {\n repeat = false;\n }\n }\n\n // finished k-means clustering\n // the next part is borrowed from gabrielflor.it\n const kClusters = {};\n for (let j = 0; j < num; j++) {\n kClusters[j] = [];\n }\n for (let i = 0; i < n; i++) {\n cluster = assignments[i];\n kClusters[cluster].push(values[i]);\n }\n let tmpKMeansBreaks = [];\n for (let j = 0; j < num; j++) {\n tmpKMeansBreaks.push(kClusters[j][0]);\n tmpKMeansBreaks.push(kClusters[j][kClusters[j].length - 1]);\n }\n tmpKMeansBreaks = tmpKMeansBreaks.sort((a, b) => a - b);\n limits.push(tmpKMeansBreaks[0]);\n for (let i = 1; i < tmpKMeansBreaks.length; i += 2) {\n const v = tmpKMeansBreaks[i];\n if (!isNaN(v) && limits.indexOf(v) === -1) {\n limits.push(v);\n }\n }\n }\n return limits;\n}\n","import Color from '../Color.js';\nconst { sqrt, pow, min, max, atan2, abs, cos, sin, exp, PI } = Math;\n\nexport default function (a, b, Kl = 1, Kc = 1, Kh = 1) {\n // Delta E (CIE 2000)\n // see http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE2000.html\n var rad2deg = function (rad) {\n return (360 * rad) / (2 * PI);\n };\n var deg2rad = function (deg) {\n return (2 * PI * deg) / 360;\n };\n a = new Color(a);\n b = new Color(b);\n const [L1, a1, b1] = Array.from(a.lab());\n const [L2, a2, b2] = Array.from(b.lab());\n const avgL = (L1 + L2) / 2;\n const C1 = sqrt(pow(a1, 2) + pow(b1, 2));\n const C2 = sqrt(pow(a2, 2) + pow(b2, 2));\n const avgC = (C1 + C2) / 2;\n const G = 0.5 * (1 - sqrt(pow(avgC, 7) / (pow(avgC, 7) + pow(25, 7))));\n const a1p = a1 * (1 + G);\n const a2p = a2 * (1 + G);\n const C1p = sqrt(pow(a1p, 2) + pow(b1, 2));\n const C2p = sqrt(pow(a2p, 2) + pow(b2, 2));\n const avgCp = (C1p + C2p) / 2;\n const arctan1 = rad2deg(atan2(b1, a1p));\n const arctan2 = rad2deg(atan2(b2, a2p));\n const h1p = arctan1 >= 0 ? arctan1 : arctan1 + 360;\n const h2p = arctan2 >= 0 ? arctan2 : arctan2 + 360;\n const avgHp =\n abs(h1p - h2p) > 180 ? (h1p + h2p + 360) / 2 : (h1p + h2p) / 2;\n const T =\n 1 -\n 0.17 * cos(deg2rad(avgHp - 30)) +\n 0.24 * cos(deg2rad(2 * avgHp)) +\n 0.32 * cos(deg2rad(3 * avgHp + 6)) -\n 0.2 * cos(deg2rad(4 * avgHp - 63));\n let deltaHp = h2p - h1p;\n deltaHp =\n abs(deltaHp) <= 180\n ? deltaHp\n : h2p <= h1p\n ? deltaHp + 360\n : deltaHp - 360;\n deltaHp = 2 * sqrt(C1p * C2p) * sin(deg2rad(deltaHp) / 2);\n const deltaL = L2 - L1;\n const deltaCp = C2p - C1p;\n const sl = 1 + (0.015 * pow(avgL - 50, 2)) / sqrt(20 + pow(avgL - 50, 2));\n const sc = 1 + 0.045 * avgCp;\n const sh = 1 + 0.015 * avgCp * T;\n const deltaTheta = 30 * exp(-pow((avgHp - 275) / 25, 2));\n const Rc = 2 * sqrt(pow(avgCp, 7) / (pow(avgCp, 7) + pow(25, 7)));\n const Rt = -Rc * sin(2 * deg2rad(deltaTheta));\n const result = sqrt(\n pow(deltaL / (Kl * sl), 2) +\n pow(deltaCp / (Kc * sc), 2) +\n pow(deltaHp / (Kh * sh), 2) +\n Rt * (deltaCp / (Kc * sc)) * (deltaHp / (Kh * sh))\n );\n return max(0, min(100, result));\n}\n","import Color from '../Color.js';\n\nexport default (...args) => {\n try {\n new Color(...args);\n return true;\n // eslint-disable-next-line\n } catch (e) {\n return false;\n }\n};\n","// some pre-defined color scales:\nimport chroma from '../chroma.js';\nimport '../io/hsl/index.js';\nimport scale from '../generator/scale.js';\n\nexport default {\n cool() {\n return scale([chroma.hsl(180, 1, 0.9), chroma.hsl(250, 0.7, 0.4)]);\n },\n hot() {\n return scale(['#000', '#f00', '#ff0', '#fff'], [0, 0.25, 0.75, 1]).mode(\n 'rgb'\n );\n }\n};\n","/**\n ColorBrewer colors for chroma.js\n\n Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and The\n Pennsylvania State University.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software distributed\n under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n CONDITIONS OF ANY KIND, either express or implied. See the License for the\n specific language governing permissions and limitations under the License.\n*/\n\nconst colorbrewer = {\n // sequential\n OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],\n PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],\n BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],\n Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],\n BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],\n YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],\n YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],\n Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],\n RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],\n Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],\n YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],\n Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],\n GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],\n Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],\n YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],\n PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],\n Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],\n PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],\n Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],\n\n // diverging\n Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],\n RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],\n RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],\n PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],\n PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],\n RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],\n BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],\n RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],\n PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],\n\n // qualitative\n Set2: ['#66c2a5', '#fc8d62', '#8da0cb', '#e78ac3', '#a6d854', '#ffd92f', '#e5c494', '#b3b3b3'],\n Accent: ['#7fc97f', '#beaed4', '#fdc086', '#ffff99', '#386cb0', '#f0027f', '#bf5b17', '#666666'],\n Set1: ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628', '#f781bf', '#999999'],\n Set3: ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'],\n Dark2: ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#66a61e', '#e6ab02', '#a6761d', '#666666'],\n Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'],\n Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc'],\n Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2']\n};\n\n// add lowercase aliases for case-insensitive matches\nfor (let key of Object.keys(colorbrewer)) {\n colorbrewer[key.toLowerCase()] = colorbrewer[key];\n}\n\nexport default colorbrewer;\n","import chroma from './src/chroma.js';\n\n// feel free to comment out anything to rollup\n// a smaller chroma.js built\n\n// io --> convert colors\nimport './src/io/cmyk/index.js';\nimport './src/io/css/index.js';\nimport './src/io/gl/index.js';\nimport './src/io/hcg/index.js';\nimport './src/io/hex/index.js';\nimport './src/io/hsi/index.js';\nimport './src/io/hsl/index.js';\nimport './src/io/hsv/index.js';\nimport './src/io/lab/index.js';\nimport './src/io/lch/index.js';\nimport './src/io/named/index.js';\nimport './src/io/num/index.js';\nimport './src/io/rgb/index.js';\nimport './src/io/temp/index.js';\nimport './src/io/oklab/index.js';\nimport './src/io/oklch/index.js';\n\n// operators --> modify existing Colors\nimport './src/ops/alpha.js';\nimport './src/ops/clipped.js';\nimport './src/ops/darken.js';\nimport './src/ops/get.js';\nimport './src/ops/luminance.js';\nimport './src/ops/mix.js';\nimport './src/ops/premultiply.js';\nimport './src/ops/saturate.js';\nimport './src/ops/set.js';\nimport './src/ops/shade.js';\n\n// interpolators\nimport './src/interpolator/rgb.js';\nimport './src/interpolator/lrgb.js';\nimport './src/interpolator/lab.js';\nimport './src/interpolator/lch.js';\nimport './src/interpolator/num.js';\nimport './src/interpolator/hcg.js';\nimport './src/interpolator/hsi.js';\nimport './src/interpolator/hsl.js';\nimport './src/interpolator/hsv.js';\nimport './src/interpolator/oklab.js';\nimport './src/interpolator/oklch.js';\n\n// generators -- > create new colors\nimport average from './src/generator/average.js';\nimport bezier from './src/generator/bezier.js';\nimport blend from './src/generator/blend.js';\nimport cubehelix from './src/generator/cubehelix.js';\nimport mix from './src/generator/mix.js';\nimport random from './src/generator/random.js';\nimport scale from './src/generator/scale.js';\n\n// other utility methods\nimport { analyze } from './src/utils/analyze.js';\nimport contrast from './src/utils/contrast.js';\nimport deltaE from './src/utils/delta-e.js';\nimport distance from './src/utils/distance.js';\nimport { limits } from './src/utils/analyze.js';\nimport valid from './src/utils/valid.js';\nimport input from './src/io/input.js';\n\n// scale\nimport scales from './src/utils/scales.js';\n\n// colors\nimport colors from './src/colors/w3cx11.js';\nimport brewer from './src/colors/colorbrewer.js';\n\nObject.assign(chroma, {\n average,\n bezier,\n blend,\n cubehelix,\n mix,\n interpolate: mix,\n random,\n scale,\n analyze,\n contrast,\n deltaE,\n distance,\n limits,\n valid,\n scales,\n input,\n colors,\n brewer\n});\n\nexport default chroma;\n","//\n// interpolates between a set of colors uzing a bezier spline\n//\n\n// @requires utils lab\nimport Color from '../Color.js';\nimport '../io/lab/index.js';\nimport scale from './scale.js';\n\n// nth row of the pascal triangle\nconst binom_row = function (n) {\n let row = [1, 1];\n for (let i = 1; i < n; i++) {\n let newrow = [1];\n for (let j = 1; j <= row.length; j++) {\n newrow[j] = (row[j] || 0) + row[j - 1];\n }\n row = newrow;\n }\n return row;\n};\n\nconst bezier = function (colors) {\n let I, lab0, lab1, lab2;\n colors = colors.map((c) => new Color(c));\n if (colors.length === 2) {\n // linear interpolation\n [lab0, lab1] = colors.map((c) => c.lab());\n I = function (t) {\n const lab = [0, 1, 2].map((i) => lab0[i] + t * (lab1[i] - lab0[i]));\n return new Color(lab, 'lab');\n };\n } else if (colors.length === 3) {\n // quadratic bezier interpolation\n [lab0, lab1, lab2] = colors.map((c) => c.lab());\n I = function (t) {\n const lab = [0, 1, 2].map(\n (i) =>\n (1 - t) * (1 - t) * lab0[i] +\n 2 * (1 - t) * t * lab1[i] +\n t * t * lab2[i]\n );\n return new Color(lab, 'lab');\n };\n } else if (colors.length === 4) {\n // cubic bezier interpolation\n let lab3;\n [lab0, lab1, lab2, lab3] = colors.map((c) => c.lab());\n I = function (t) {\n const lab = [0, 1, 2].map(\n (i) =>\n (1 - t) * (1 - t) * (1 - t) * lab0[i] +\n 3 * (1 - t) * (1 - t) * t * lab1[i] +\n 3 * (1 - t) * t * t * lab2[i] +\n t * t * t * lab3[i]\n );\n return new Color(lab, 'lab');\n };\n } else if (colors.length >= 5) {\n // general case (degree n bezier)\n let labs, row, n;\n labs = colors.map((c) => c.lab());\n n = colors.length - 1;\n row = binom_row(n);\n I = function (t) {\n const u = 1 - t;\n const lab = [0, 1, 2].map((i) =>\n labs.reduce(\n (sum, el, j) =>\n sum + row[j] * u ** (n - j) * t ** j * el[i],\n 0\n )\n );\n return new Color(lab, 'lab');\n };\n } else {\n throw new RangeError('No point in running bezier with only one color.');\n }\n return I;\n};\n\nexport default (colors) => {\n const f = bezier(colors);\n f.scale = () => scale(f);\n return f;\n};\n","import Color from '../Color.js';\nimport '../ops/luminance.js';\n\nexport default (a, b) => {\n // WCAG contrast ratio\n // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef\n a = new Color(a);\n b = new Color(b);\n const l1 = a.luminance();\n const l2 = b.luminance();\n return l1 > l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);\n};\n","import Color from '../Color.js';\n\n// simple Euclidean distance\nexport default function (a, b, mode = 'lab') {\n // Delta E (CIE 1976)\n // see http://www.brucelindbloom.com/index.html?Equations.html\n a = new Color(a);\n b = new Color(b);\n const l1 = a.get(mode);\n const l2 = b.get(mode);\n let sum_sq = 0;\n for (let i in l1) {\n const d = (l1[i] || 0) - (l2[i] || 0);\n sum_sq += d * d;\n }\n return Math.sqrt(sum_sq);\n}\n","(function(context) {\n\n /**\n * Defines an available color.\n *\n * @typedef {Object} ColorSpec\n * @property {string=} name A name for the color, e.g., 'red'\n * @property {string} source The hex-based color string, e.g., '#FF0'\n * @property {RGB} rgb The {@link RGB} color values\n */\n\n /**\n * Describes a matched color.\n *\n * @typedef {Object} ColorMatch\n * @property {string} name The name of the matched color, e.g., 'red'\n * @property {string} value The hex-based color string, e.g., '#FF0'\n * @property {RGB} rgb The {@link RGB} color values.\n */\n\n /**\n * Provides the RGB breakdown of a color.\n *\n * @typedef {Object} RGB\n * @property {number} r The red component, from 0 to 255\n * @property {number} g The green component, from 0 to 255\n * @property {number} b The blue component, from 0 to 255\n */\n\n /**\n * Gets the nearest color, from the given list of {@link ColorSpec} objects\n * (which defaults to {@link nearestColor.DEFAULT_COLORS}).\n *\n * Probably you wouldn't call this method directly. Instead you'd get a custom\n * color matcher by calling {@link nearestColor.from}.\n *\n * @public\n * @param {RGB|string} needle Either an {@link RGB} color or a hex-based\n * string representing one, e.g., '#FF0'\n * @param {Array.<ColorSpec>=} colors An optional list of available colors\n * (defaults to {@link nearestColor.DEFAULT_COLORS})\n * @return {ColorMatch|string} If the colors in the provided list had names,\n * then a {@link ColorMatch} object with the name and (hex) value of the\n * nearest color from the list. Otherwise, simply the hex value.\n *\n * @example\n * nearestColor({ r: 200, g: 50, b: 50 }); // => '#f00'\n * nearestColor('#f11'); // => '#f00'\n * nearestColor('#f88'); // => '#f80'\n * nearestColor('#ffe'); // => '#ff0'\n * nearestColor('#efe'); // => '#ff0'\n * nearestColor('#abc'); // => '#808'\n * nearestColor('red'); // => '#f00'\n * nearestColor('foo'); // => throws\n */\n function nearestColor(needle, colors) {\n needle = parseColor(needle);\n\n if (!needle) {\n return null;\n }\n\n var distanceSq,\n minDistanceSq = Infinity,\n rgb,\n value;\n\n colors || (colors = nearestColor.DEFAULT_COLORS);\n\n for (var i = 0; i < colors.length; ++i) {\n rgb = colors[i].rgb;\n\n distanceSq = (\n Math.pow(needle.r - rgb.r, 2) +\n Math.pow(needle.g - rgb.g, 2) +\n Math.pow(needle.b - rgb.b, 2)\n );\n\n if (distanceSq < minDistanceSq) {\n minDistanceSq = distanceSq;\n value = colors[i];\n }\n }\n\n if (value.name) {\n return {\n name: value.name,\n value: value.source,\n rgb: value.rgb,\n distance: Math.sqrt(minDistanceSq)\n };\n }\n\n return value.source;\n }\n\n /**\n * Provides a matcher to find the nearest color based on the provided list of\n * available colors.\n *\n * @public\n * @param {Array.<string>|Object} availableColors An array of hex-based color\n * strings, or an object mapping color *names* to hex values.\n * @return {function(string):ColorMatch|string} A function with the same\n * behavior as {@link nearestColor}, but with the list of colors\n * predefined.\n *\n * @example\n * var colors = {\n * 'maroon': '#800',\n * 'light yellow': { r: 255, g: 255, b: 51 },\n * 'pale blue': '#def',\n * 'white': 'fff'\n * };\n *\n * var bgColors = [\n * '#eee',\n * '#444'\n * ];\n *\n * var invalidColors = {\n * 'invalid': 'foo'\n * };\n *\n * var getColor = nearestColor.from(colors);\n * var getBGColor = getColor.from(bgColors);\n * var getAnyColor = nearestColor.from(colors).or(bgColors);\n *\n * getColor('ffe');\n * // => { name: 'white', value: 'fff', rgb: { r: 255, g: 255, b: 255 }, distance: 17}\n *\n * getColor('#f00');\n * // => { name: 'maroon', value: '#800', rgb: { r: 136, g: 0, b: 0 }, distance: 119}\n *\n * getColor('#ff0');\n * // => { name: 'light yellow', value: '#ffff33', rgb: { r: 255, g: 255, b: 51 }, distance: 51}\n *\n * getBGColor('#fff'); // => '#eee'\n * getBGColor('#000'); // => '#444'\n *\n * getAnyColor('#f00');\n * // => { name: 'maroon', value: '#800', rgb: { r: 136, g: 0, b: 0 }, distance: 119}\n *\n * getAnyColor('#888'); // => '#444'\n *\n * nearestColor.from(invalidColors); // => throws\n */\n nearestColor.from = function from(availableColors) {\n var colors = mapColors(availableColors),\n nearestColorBase = nearestColor;\n\n var matcher = function nearestColor(hex) {\n return nearestColorBase(hex, colors);\n };\n\n // Keep the 'from' method, to support changing the list of available colors\n // multiple times without needing to keep a reference to the original\n // nearestColor function.\n matcher.from = from;\n\n // Also provide a way to combine multiple color lists.\n matcher.or = function or(alternateColors) {\n var extendedColors = colors.concat(mapColors(alternateColors));\n return nearestColor.from(extendedColors);\n };\n\n return matcher;\n };\n\n /**\n * Given either an array or object of colors, returns an array of\n * {@link ColorSpec} objects (with {@link RGB} values).\n *\n * @private\n * @param {Array.<string>|Object} colors An array of hex-based color strings, or\n * an object mapping color *names* to hex values.\n * @return {Array.<ColorSpec>} An array of {@link ColorSpec} objects\n * representing the same colors passed in.\n */\n function mapColors(colors) {\n if (colors instanceof Array) {\n return colors.map(function(color) {\n return createColorSpec(color);\n });\n }\n\n return Object.keys(colors).map(function(name) {\n return createColorSpec(colors[name], name);\n });\n };\n\n /**\n * Parses a color from a string.\n *\n * @private\n * @param {RGB|string} source\n * @return {RGB}\n *\n * @example\n * parseColor({ r: 3, g: 22, b: 111 }); // => { r: 3, g: 22, b: 111 }\n * parseColor('#f00'); // => { r: 255, g: 0, b: 0 }\n * parseColor('#04fbc8'); // => { r: 4, g: 251, b: 200 }\n * parseColor('#FF0'); // => { r: 255, g: 255, b: 0 }\n * parseColor('rgb(3, 10, 100)'); // => { r: 3, g: 10, b: 100 }\n * parseColor('rgb(50%, 0%, 50%)'); // => { r: 128, g: 0, b: 128 }\n * parseColor('aqua'); // => { r: 0, g: 255, b: 255 }\n * parseColor('fff'); // => { r: 255, g: 255, b: 255 }\n * parseColor('foo'); // => throws\n */\n function parseColor(source) {\n var red, green, blue;\n\n if (typeof source === 'object') {\n return source;\n }\n\n if (source in nearestColor.STANDARD_COLORS) {\n return parseColor(nearestColor.STANDARD_COLORS[source]);\n }\n\n var hexMatch = source.match(/^#?((?:[0-9a-f]{3}){1,2})$/i);\n if (hexMatch) {\n hexMatch = hexMatch[1];\n\n if (hexMatch.length === 3) {\n hexMatch = [\n hexMatch.charAt(0) + hexMatch.charAt(0),\n hexMatch.charAt(1) + hexMatch.charAt(1),\n hexMatch.charAt(2) + hexMatch.charAt(2)\n ];\n\n } else {\n hexMatch = [\n hexMatch.substring(0, 2),\n hexMatch.substring(2, 4),\n hexMatch.substring(4, 6)\n ];\n }\n\n red = parseInt(hexMatch[0], 16);\n green = parseInt(hexMatch[1], 16);\n blue = parseInt(hexMatch[2], 16);\n\n return { r: red, g: green, b: blue };\n }\n\n var rgbMatch = source.match(/^rgb\\(\\s*(\\d{1,3}%?),\\s*(\\d{1,3}%?),\\s*(\\d{1,3}%?)\\s*\\)$/i);\n if (rgbMatch) {\n red = parseComponentValue(rgbMatch[1]);\n green = parseComponentValue(rgbMatch[2]);\n blue = parseComponentValue(rgbMatch[3]);\n\n return { r: red, g: green, b: blue };\n }\n\n throw Error('\"' + source + '\" is not a valid color');\n }\n\n /**\n * Creates a {@link ColorSpec} from either a string or an {@link RGB}.\n *\n * @private\n * @param {string|RGB} input\n * @param {string=} name\n * @return {ColorSpec}\n *\n * @example\n * createColorSpec('#800'); // => {\n * source: '#800',\n * rgb: { r: 136, g: 0, b: 0 }\n * }\n *\n * createColorSpec('#800', 'maroon'); // => {\n * name: 'maroon',\n * source: '#800',\n * rgb: { r: 136, g: 0, b: 0 }\n * }\n */\n function createColorSpec(input, name) {\n var color = {};\n\n if (name) {\n color.name = name;\n }\n\n if (typeof input === 'string') {\n color.source = input;\n color.rgb = parseColor(input);\n\n } else if (typeof input === 'object') {\n // This is for if/when we're concatenating lists of colors.\n if (input.source) {\n return createColorSpec(input.source, input.name);\n }\n\n color.rgb = input;\n color.source = rgbToHex(input);\n }\n\n return color;\n }\n\n /**\n * Parses a value between 0-255 from a string.\n *\n * @private\n * @param {string} string\n * @return {number}\n *\n * @example\n * parseComponentValue('100'); // => 100\n * parseComponentValue('100%'); // => 255\n * parseComponentValue('50%'); // => 128\n */\n function parseComponentValue(string) {\n if (string.charAt(string.length - 1) === '%') {\n return Math.round(parseInt(string, 10) * 255 / 100);\n }\n\n return Number(string);\n }\n\n /**\n * Converts an {@link RGB} color to its hex representation.\n *\n * @private\n * @param {RGB} rgb\n * @return {string}\n *\n * @example\n * rgbToHex({ r: 255, g: 128, b: 0 }); // => '#ff8000'\n */\n function rgbToHex(rgb) {\n return '#' + leadingZero(rgb.r.toString(16)) +\n leadingZero(rgb.g.toString(16)) + leadingZero(rgb.b.toString(16));\n }\n\n /**\n * Puts a 0 in front of a numeric string if it's only one digit. Otherwise\n * nothing (just returns the value passed in).\n *\n * @private\n * @param {string} value\n * @return\n *\n * @example\n * leadingZero('1'); // => '01'\n * leadingZero('12'); // => '12'\n */\n function leadingZero(value) {\n if (value.length === 1) {\n value = '0' + value;\n }\n return value;\n }\n\n /**\n * A map from the names of standard CSS colors to their hex values.\n */\n nearestColor.STANDARD_COLORS = {\n aqua: '#0ff',\n black: '#000',\n blue: '#00f',\n fuchsia: '#f0f',\n gray: '#808080',\n green: '#008000',\n lime: '#0f0',\n maroon: '#800000',\n navy: '#000080',\n olive: '#808000',\n orange: '#ffa500',\n purple: '#800080',\n red: '#f00',\n silver: '#c0c0c0',\n teal: '#008080',\n white: '#fff',\n yellow: '#ff0'\n };\n\n /**\n * Default colors. Comprises the colors of the rainbow (good ol' ROY G. BIV).\n * This list will be used for calls to {@nearestColor} that don't specify a list\n * of available colors to match.\n */\n nearestColor.DEFAULT_COLORS = mapColors([\n '#f00', // r\n '#f80', // o\n '#ff0', // y\n '#0f0', // g\n '#00f', // b\n '#008', // i\n '#808' // v\n ]);\n\n nearestColor.VERSION = '0.4.4';\n\n if (typeof module === 'object' && module && module.exports) {\n module.exports = nearestColor;\n } else {\n context.nearestColor = nearestColor;\n }\n\n}(this));\n","/**\n * Represents an HSL (Hue, Saturation, Lightness) color unit.\n */\nexport class UnitHSL {\n /** Hue component (0–360) */\n h: number;\n /** Saturation component (0–100%) */\n s: number;\n /** Lightness component (0–100%) */\n l: number;\n\n /**\n * Create a new UnitHSL instance.\n * @param {[number, number, number]} components - The HSL components: [h, s, l]\n */\n constructor([h, s, l]: [number, number, number]) {\n this.h = Number(!isNaN(h) ? h.toFixed(0) : '0');\n this.s = Number((s * 100).toFixed(0));\n this.l = Number((l * 100).toFixed(0));\n }\n\n /**\n * Converts the HSL unit to a CSS string representation.\n * @returns {string} - A string like \"hsl(30, 50%, 80%)\"\n * @example\n * ```ts\n * const hslUnit = new UnitHSL([30, 0.5, 0.8]);\n * const hslString = hslUnit.toString(); // \"hsl(30, 50%, 80%)\"\n * ```\n */\n toString(): string {\n return `hsl(${this.h}, ${this.s}%, ${this.l}%)`;\n }\n}\n\n/**\n * Represents an HSL (Hue, Saturation, Lightness) color unit with float values.\n */\nexport class UnitHSLFloat {\n /** Hue component */\n h: number;\n /** Saturation component */\n s: number;\n /** Lightness component */\n l: number;\n\n /**\n * Create a new UnitHSLFloat instance.\n * @param {[number, number, number]} components - The HSL components: [h, s, l]\n */\n constructor([h, s, l]: [number, number, number]) {\n this.h = Number(!isNaN(h) ? h.toFixed(0) : '0');\n this.s = Number(s.toFixed(2));\n this.l = Number(l.toFixed(2));\n }\n\n /**\n * Converts the HSL float unit to a string.\n * @returns {string} - A string like \"30, 0.50, 0.80\"\n * @example\n * ```ts\n * const hslFloatUnit = new UnitHSLFloat([30, 0.5, 0.8]);\n * const hslFloatString = hslFloatUnit.toString(); // \"30, 0.50, 0.80\"\n * ```\n */\n toString(): string {\n return `${this.h}, ${this.s}, ${this.l}`;\n }\n}\n","/**\n * Represents an XYZ color unit.\n */\nexport class UnitXYZ {\n /** X component */\n x: number;\n /** Y component */\n y: number;\n /** Z component */\n z: number;\n\n /**\n * Create a new UnitXYZ instance.\n * @param {{ x: number, y: number, z: number }} components - The XYZ components.\n */\n constructor({ x, y, z }: { x: number; y: number; z: number }) {\n this.x = x;\n this.y = y;\n this.z = z;\n }\n\n /**\n * Converts the XYZ unit to a string representation.\n * @returns {string} - The string representation of the XYZ unit.\n * @example\n * ```ts\n * const xyzUnit = new UnitXYZ({ x: 0.4, y: 0.6, z: 0.8 });\n * const xyzString = xyzUnit.toString(); // \"0.4, 0.6, 0.8\"\n * ```\n */\n toString(): string {\n return `${this.x}, ${this.y}, ${this.z}`;\n }\n}\n","/**\n * Represents a CMYK color unit.\n */\nexport class UnitCMYK {\n /** Cyan component */\n c: number;\n /** Magenta component */\n m: number;\n /** Yellow component */\n y: number;\n /** Black (Key) component */\n k: number;\n\n /**\n * Create a new UnitCMYK instance.\n * @param {{ c: number, m: number, y: number, k: number }} components - The CMYK components.\n */\n constructor({ c, m, y, k }: { c: number; m: number; y: number; k: number }) {\n this.c = c;\n this.m = m;\n this.y = y;\n this.k = k;\n }\n\n /**\n * Converts the CMYK unit to a string representation.\n * @returns {string} - The string representation of the CMYK unit.\n * @example\n * ```ts\n * const cmykUnit = new UnitCMYK({ c: 0.2, m: 0.4, y: 0.6, k: 0.1 });\n * const cmykString = cmykUnit.toString(); // \"0.2, 0.4, 0.6, 0.1\"\n * ```\n */\n toString(): string {\n return `${this.c}, ${this.m}, ${this.y}, ${this.k}`;\n }\n}\n","/**\n * Represents an RGB float color unit.\n */\nexport class UnitRGBFloat {\n /** Red component */\n r: number;\n /** Green component */\n g: number;\n /** Blue component */\n b: number;\n\n /**\n * Create a new UnitRGBFloat instance.\n * @param {{ r: number, g: number, b: number }} components - The RGB float components.\n */\n constructor({ r, g, b }: { r: number; g: number; b: number }) {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n\n /**\n * Converts the RGB float unit to a string representation.\n * @returns {string} - The string representation of the RGB float unit.\n * @example\n * ```ts\n * const rgbFloatUnit = new UnitRGBFloat({ r: 255, g: 128, b: 0 });\n * const rgbFloatString = rgbFloatUnit.toString(); // \"255, 128, 0\"\n * ```\n */\n toString(): string {\n return `${this.r}, ${this.g}, ${this.b}`;\n }\n}\n","/**\n * Represents an HWB (Hue, Whiteness, Blackness) color unit.\n */\nexport class UnitHWB {\n /** Hue component */\n h: number;\n /** Whiteness component */\n w: number;\n /** Blackness component */\n b: number;\n\n /**\n * Create a new UnitHWB instance.\n * @param {{ h: number, w: number, b: number }} components - The HWB components.\n */\n constructor({ h, w, b }: { h: number; w: number; b: number }) {\n this.h = h;\n this.w = w;\n this.b = b;\n }\n\n /**\n * Converts the HWB unit to a string representation.\n * @returns {string} - A string like `\"200, 0.2, 0.1\"`\n * @example\n * ```ts\n * const hwbUnit = new UnitHWB({ h: 200, w: 0.2, b: 0.1 });\n * const hwbString = hwbUnit.toString(); // \"200, 0.2, 0.1\"\n * ```\n */\n toString(): string {\n return `${this.h}, ${this.w}, ${this.b}`;\n }\n}\n","/**\n * Represents a LAB (CIELAB) color unit.\n */\nexport class UnitLAB {\n /** Lightness component */\n l: number;\n /** A color component */\n a: number;\n /** B color component */\n b: number;\n\n /**\n * Create a new UnitLAB instance.\n * @param {[number, number, number]} components - The LAB components: [l, a, b]\n */\n constructor([l, a, b]: [number, number, number]) {\n this.l = Number(l.toFixed(2));\n this.a = Number(a.toFixed(2));\n this.b = Number(b.toFixed(2));\n }\n\n /**\n * Converts the LAB unit to a string representation.\n * @returns {string} - The string representation of the LAB unit.\n * @example\n * ```ts\n * const labUnit = new UnitLAB([70, 10, 20]);\n * const labString = labUnit.toString(); // \"70, 10, 20\"\n * ```\n */\n toString(): string {\n return `${this.l}, ${this.a}, ${this.b}`;\n }\n}\n","/**\n * Represents an OKLAB color unit.\n */\nexport class UnitOKLAB {\n /** Lightness component */\n l: number;\n /** First color opponent axis */\n a: number;\n /** Second color opponent axis */\n b: number;\n\n /**\n * Create a new UnitOKLAB instance.\n * @param {[number, number, number]} components - The OKLAB components [l, a, b].\n */\n constructor([l, a, b]: [number, number, number]) {\n this.l = Number(l.toFixed(2));\n this.a = Number(a.toFixed(2));\n this.b = Number(b.toFixed(2));\n }\n\n /**\n * Converts the OKLAB unit to a string representation.\n * @returns {string} - The string representation of the OKLAB unit.\n * @example\n * ```ts\n * const oklabUnit = new UnitOKLAB([70, 30, 45]);\n * const oklabString = oklabUnit.toString(); // \"70, 30, 45\"\n * ```\n */\n toString(): string {\n return `${this.l}, ${this.a}, ${this.b}`;\n }\n}\n","/**\n * Represents an HSV (Hue, Saturation, Value) color unit.\n */\nexport class UnitHSV {\n /** Hue component */\n h: number;\n /** Saturation component */\n s: number;\n /** Value component */\n v: number;\n\n /**\n * Create a new UnitHSV instance.\n * @param {[number, number, number]} components - The HSV components: [h, s, v]\n */\n constructor([h, s, v]: [number, number, number]) {\n this.h = Number(!isNaN(h) ? h.toFixed(2) : '0');\n this.s = Number(s.toFixed(2));\n this.v = Number(v.toFixed(2));\n }\n\n /**\n * Converts the HSV unit to a string representation.\n * @returns {string} - A string like `\"30.00, 0.50, 0.80\"`\n * @example\n * ```ts\n * const hsvUnit = new UnitHSV([30, 0.5, 0.8]);\n * const hsvString = hsvUnit.toString(); // \"30.00, 0.50, 0.80\"\n * ```\n */\n toString(): string {\n return `${this.h}, ${this.s}, ${this.v}`;\n }\n}\n","/**\n * Represents an LCH (CIELCH) color unit.\n */\nexport class UnitLCH {\n /** Lightness component */\n l: number;\n /** Chroma component */\n c: number;\n /** Hue component */\n h: number;\n\n /**\n * Create a new UnitLCH instance.\n * @param {[number, number, number]} components - The LCH components: [l, c, h]\n */\n constructor([l, c, h]: [number, number, number]) {\n this.l = Number(l.toFixed(2));\n this.c = Number(c.toFixed(2));\n this.h = Number(!isNaN(h) ? h.toFixed(2) : '0');\n }\n\n /**\n * Converts the LCH unit to a string representation.\n * @returns {string} - A string like `\"70.00, 30.00, 45.00\"`\n * @example\n * ```ts\n * const lchUnit = new UnitLCH([70, 30, 45]);\n * const lchString = lchUnit.toString(); // \"70.00, 30.00, 45.00\"\n * ```\n */\n toString(): string {\n return `${this.l}, ${this.c}, ${this.h}`;\n }\n}\n","/**\n * Represents an OKLCH color unit.\n */\nexport class UnitOKLCH {\n /** Lightness component */\n l: number;\n /** Chroma component */\n c: number;\n /** Hue component */\n h: number;\n\n /**\n * Create a new UnitOKLCH instance.\n * @param {[number, number, number]} components - The OKLCH components: [l, c, h]\n */\n constructor([l, c, h]: [number, number, number]) {\n this.l = Number(l.toFixed(2));\n this.c = Number(c.toFixed(2));\n this.h = Number(!isNaN(h) ? h.toFixed(2) : '0');\n }\n\n /**\n * Converts the OKLCH unit to a string representation.\n * @returns {string} - The string representation of the OKLCH unit.\n * @example\n * ```ts\n * const oklchUnit = new UnitOKLCH([70, 30, 45]);\n * const oklchString = oklchUnit.toString(); // \"70.00, 30.00, 45.00\"\n * ```\n */\n toString(): string {\n return `${this.l}, ${this.c}, ${this.h}`;\n }\n}\n","/**\n * Represents an HSI (Hue, Saturation, Intensity) color unit.\n */\nexport class UnitHSI {\n /** Hue component */\n h: number;\n /** Saturation component */\n s: number;\n /** Intensity component */\n i: number;\n\n /**\n * Create a new UnitHSI instance.\n * @param {[number, number, number]} components - The HSI components: [h, s, i]\n */\n constructor([h, s, i]: [number, number, number]) {\n this.h = Number(!isNaN(h) ? h.toFixed(2) : '0');\n this.s = Number(s.toFixed(2));\n this.i = Number(i.toFixed(2));\n }\n\n /**\n * Converts the HSI unit to a string representation.\n * @returns {string} - The string representation of the HSI unit.\n * @example\n * ```ts\n * const hsiUnit = new UnitHSI([30, 0.5, 0.8]);\n * const hsiString = hsiUnit.toString(); // \"30, 0.5, 0.8\"\n * ```\n */\n toString(): string {\n return `${this.h}, ${this.s}, ${this.i}`;\n }\n}\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusHSLObjectType,\n MoebiusRGBObjectType\n} from '../../types';\nimport { UnitHSLFloat } from '../color-objects/hsl';\nimport { UnitRGBFloat } from '../color-objects/rgb';\n\n/**\n * Converts a color to its float representation.\n * @param {MoebiusChromaColorInputType} color - The input color in hex, rgb, or rgba format.\n * @param {string} [type] - The color type ('hsl' for HSL, undefined for RGB).\n * @returns {UnitHSLFloat | UnitRGBFloat} - The float representation of the color.\n * @example\n * ```ts\n * const hslFloatColor = toFloat('#00ff00', 'hsl');\n * console.log(hslFloatColor.toString()); // 120, 100, 50\n * ```\n * @example\n * ```ts\n * const rgbFloatColor = toFloat('#00ff00');\n * console.log(rgbFloatColor.toString()); // 0, 1, 0\n * ```\n */\nexport const toFloat = (\n color: MoebiusChromaColorInputType,\n type?: string\n): MoebiusHSLObjectType | MoebiusRGBObjectType => {\n if (type === 'hsl') {\n // Convert the color to HSL and create a new HSL float unit\n return new UnitHSLFloat(chroma(color).hsl());\n }\n\n // Convert the color to RGB and create a new RGB float unit\n const _rgb = chroma(color).rgb();\n const rgbFloat = new UnitRGBFloat({\n r: Number((_rgb[0] / 255).toFixed(2)),\n g: Number((_rgb[1] / 255).toFixed(2)),\n b: Number((_rgb[2] / 255).toFixed(2))\n });\n\n return rgbFloat;\n};\n","/**\n * Normalizes an RGB input value.\n * @param {number} r - The input value in the RGB color space (0 to 255).\n * @returns {number} - The normalized value.\n */\nexport const normalizeRGBInput = (r: number): number => {\n if ((r /= 255) <= 0.04045) return r / 12.92;\n\n return Math.pow((r + 0.055) / 1.055, 2.4);\n};\n\n/**\n * Normalizes a LAB input value.\n * @param {number} t - The input value in the LAB color space.\n * @returns {number} - The normalized value.\n */\nexport const normalizeLABInput = (t: number): number => {\n if (t > 0.008856452) return Math.pow(t, 1 / 3);\n\n return t / 0.12841855 + 0.137931034;\n};\n","import {\n MoebiusCMYKObjectType,\n MoebiusColorValueHexType,\n MoebiusColorValueRgbType,\n MoebiusHSIObjectType,\n MoebiusHSLObjectType,\n MoebiusHSVObjectType,\n MoebiusHWBObjectType,\n MoebiusLABObjectType,\n MoebiusLCHObjectType,\n MoebiusColorInterface,\n MoebiusRGBObjectType,\n MoebiusXYZObjectType,\n MoebiusChromaColorInputType\n} from '../types';\nimport * as CONVERTERS from '../utils/converters';\n\n/**\n * MoebiusColor class representing a color with various formats and conversions.\n *\n * @example\n * ```ts\n * const mColor = new MoebiusColor('#ff9900')\n * ```\n */\nexport class MoebiusColor implements MoebiusColorInterface {\n color: MoebiusChromaColorInputType;\n name: string;\n hex: MoebiusColorValueHexType;\n rgb: MoebiusColorValueRgbType;\n hsl: MoebiusHSLObjectType;\n hwb: MoebiusHWBObjectType;\n hsv: MoebiusHSVObjectType;\n lab: MoebiusLABObjectType;\n xyz: MoebiusXYZObjectType;\n lch: MoebiusLCHObjectType;\n oklch: MoebiusLCHObjectType;\n hsi: MoebiusHSIObjectType;\n oklab: MoebiusLABObjectType;\n cmyk: MoebiusCMYKObjectType;\n rgbFloat: MoebiusRGBObjectType;\n hslFloat: MoebiusHSLObjectType;\n\n /**\n * Creates an instance of MoebiusColor.\n * @param {MoebiusChromaColorInputType} color - The hex value of the color.\n * @param {string} name - The name of the color\n *\n * @throws Will throw an error if init has not been run before creating an instance.\n */\n constructor(color: MoebiusChromaColorInputType, name: string) {\n this.color = color;\n this.name = name;\n\n this.hex = CONVERTERS.toHEX(this.color);\n this.cmyk = CONVERTERS.toCMYK(this.color);\n this.xyz = CONVERTERS.toXYZ(this.color);\n this.hsl = CONVERTERS.toHSL(this.color);\n this.hwb = CONVERTERS.toHWB(this.color);\n this.lab = CONVERTERS.toLAB(this.color);\n this.oklab = CONVERTERS.toOKLAB(this.color);\n this.hsv = CONVERTERS.toHSV(this.color);\n this.lch = CONVERTERS.toLCH(this.color);\n this.oklch = CONVERTERS.toOKLCH(this.color);\n this.hsi = CONVERTERS.toHSI(this.color);\n this.rgb = CONVERTERS.toRGB(this.color);\n this.rgbFloat = CONVERTERS.toFloat(this.color) as MoebiusRGBObjectType;\n this.hslFloat = CONVERTERS.toFloat(\n this.color,\n 'hsl'\n ) as MoebiusHSLObjectType;\n }\n /**\n * Converts the color to an object in the specified color space.\n * @param {string} type - The color space type (e.g., 'rgb' or 'hsl').\n * @returns {MoebiusRGBObjectType | MoebiusHSLObjectType} The color object in the specified color space.\n */\n toObject(type?: string): MoebiusRGBObjectType | MoebiusHSLObjectType {\n return CONVERTERS.toObject(this.color, type);\n }\n /**\n * Converts the color to a floating-point representation in the specified color space.\n * @param {string} type - The color space type (e.g., 'rgb' or 'hsl').\n * @returns {MoebiusRGBObjectType | MoebiusHSLObjectType} The floating-point representation of the color in the specified color space.\n */\n toFloat(type?: string): MoebiusRGBObjectType | MoebiusHSLObjectType {\n return CONVERTERS.toFloat(this.color, type);\n }\n}\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType\n} from '../../types';\n\n/**\n * Converts a color to its corresponding HEX representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in various formats (HEX, RGB, HSL, etc.).\n * @returns {MoebiusColorValueHexType} The HEX representation of the color.\n *\n * @example\n * ```ts\n * const hexColor = toHEX('#3498db');\n * console.log(hexColor); // Output: '#3498db'\n * ```\n */\nexport const toHEX = (\n color: MoebiusChromaColorInputType\n): MoebiusColorValueHexType => {\n return chroma(color).hex();\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusCMYKObjectType,\n MoebiusChromaColorInputType\n} from '../../types';\nimport { UnitCMYK } from '../color-objects';\n\n/**\n * Converts an RGB color to its CMYK representation.\n * @param {MoebiusChromaColorInputType} color - The input color in hex, rgb, or rgba format.\n * @returns {MoebiusCMYKObjectType} - The CMYK representation of the color.\n * @example\n * ```ts\n * const cmykColor = toCMYK('#00ff00');\n * console.log(cmykColor); // { c: 40, m: 0, y: 100, k: 0 }\n * ```\n */\nexport const toCMYK = (\n color: MoebiusChromaColorInputType\n): MoebiusCMYKObjectType => {\n // Convert the color to RGB components\n let [r, b, g] = chroma(color).rgb();\n\n // Normalize RGB values to the range [0, 1]\n r /= 255;\n g /= 255;\n b /= 255;\n\n // Calculate the CMYK components\n const k = +(1 - Math.max(r, g, b));\n const c = +((1 - r - k) / (1 - k) || 0);\n const m = +((1 - g - k) / (1 - k) || 0);\n const y = +((1 - b - k) / (1 - k) || 0);\n\n // Create a new CMYK unit\n return new UnitCMYK({\n c: Number((c * 100).toFixed()),\n m: Number((m * 100).toFixed()),\n y: Number((y * 100).toFixed()),\n k: Number((k * 100).toFixed())\n });\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusXYZObjectType } from '../../types';\nimport { UnitXYZ } from '../color-objects';\nimport { normalizeLABInput, normalizeRGBInput } from '../normalize-color-units';\n\n/**\n * Converts a color from RGB to CIE 1931 XYZ color space.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hexadecimal format.\n * @returns {MoebiusXYZObjectType} - An object representing the XYZ color values.\n */\nexport const toXYZ = (\n color: MoebiusChromaColorInputType\n): MoebiusXYZObjectType => {\n // Extract RGB components from the input color\n let [r, b, g] = chroma(color).rgb();\n\n // Normalize RGB values\n r = normalizeRGBInput(r);\n g = normalizeRGBInput(g);\n b = normalizeRGBInput(b);\n\n // Convert RGB to XYZ\n const x = normalizeLABInput(\n (0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / 0.95047\n );\n const y = normalizeLABInput(\n (0.2126729 * r + 0.7151522 * g + 0.072175 * b) / 1\n );\n const z = normalizeLABInput(\n (0.0193339 * r + 0.119192 * g + 0.9503041 * b) / 1.08883\n );\n\n // Return XYZ color values as a UnitXYZ object\n return new UnitXYZ({\n x: Number(x.toFixed(2)),\n y: Number(y.toFixed(2)),\n z: Number(z.toFixed(2))\n });\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusHSLObjectType } from '../../types';\nimport { UnitHSL } from '../color-objects';\n\n/**\n * Converts a color to its corresponding HSL object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusHSLObjectType} The HSL color representation object.\n *\n * @example\n * ```ts\n * const hslObject = toHSL('#3498db');\n * console.log(hslObject); // Output: { h: 207.76, s: 0.86, l: 0.56 }\n * ```\n */\nexport const toHSL = (\n color: MoebiusChromaColorInputType\n): MoebiusHSLObjectType => {\n return new UnitHSL(chroma(color).hsl());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusHWBObjectType } from '../../types';\nimport { UnitHWB } from '../color-objects';\n\n/**\n * Converts a color to its corresponding HWB object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusHWBObjectType} The HWB color representation object.\n *\n * @example\n * ```ts\n * const hwbObject = toHWB('#3498db');\n * console.log(hwbObject); // Output: { h: 207.76, w: 0.5, b: 0.14 }\n * ```\n */\nexport const toHWB = (\n color: MoebiusChromaColorInputType\n): MoebiusHWBObjectType => {\n let [r, b, g] = chroma(color).rgb();\n\n r /= 255;\n g /= 255;\n b /= 255;\n\n const w = Math.min(r, g, b);\n const v = Math.max(r, g, b);\n const black = 1 - v;\n\n if (v === w) return { h: 0, w: w, b: black };\n\n const f = r === w ? g - b : g === w ? b - r : r - g;\n const i = r === w ? 3 : g === w ? 5 : 1;\n\n return new UnitHWB({\n h: Number(((i - f / (v - w)) / 6).toFixed(2)),\n w: Number(w.toFixed(2)),\n b: Number(black.toFixed(2))\n });\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusLABObjectType } from '../../types';\nimport { UnitLAB } from '../color-objects';\n\n/**\n * Converts a color to its corresponding LAB object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusLABObjectType} The LAB color representation object.\n *\n * @example\n * ```ts\n * const labObject = toLAB('#3498db');\n * console.log(labObject); // Output: { l: 54.24, a: -12.56, b: -43.81 }\n * ```\n */\nexport const toLAB = (\n color: MoebiusChromaColorInputType\n): MoebiusLABObjectType => {\n return new UnitLAB(chroma(color).lab());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusLABObjectType } from '../../types';\nimport { UnitOKLAB } from '../color-objects';\n\n/**\n * Converts a color to its OKLAB representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusLABObjectType} The OKLAB representation of the input color.\n *\n * @example\n * ```ts\n * const oklabColor = toOKLAB('#3498db');\n * console.log(oklabColor); // Output: { l: 52.42, a: -9.93, b: -39.49 }\n * ```\n */\nexport const toOKLAB = (\n color: MoebiusChromaColorInputType\n): MoebiusLABObjectType => {\n return new UnitOKLAB(chroma(color).oklab());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusHSVObjectType } from '../../types';\nimport { UnitHSV } from '../color-objects';\n\n/**\n * Converts a color to its corresponding HSV object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusHSVObjectType} The HSV color representation object.\n *\n * @example\n * ```ts\n * const hsvObject = toHSV('#3498db');\n * console.log(hsvObject); // Output: { h: 207.76, s: 0.86, v: 0.85 }\n * ```\n */\nexport const toHSV = (\n color: MoebiusChromaColorInputType\n): MoebiusHSVObjectType => {\n return new UnitHSV(chroma(color).hsv());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusLCHObjectType } from '../../types';\nimport { UnitLCH } from '../color-objects';\n\n/**\n * Converts a color to its corresponding LCH object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusLCHObjectType} The LCH color representation object.\n *\n * @example\n * ```ts\n * const lchObject = toLCH('#3498db');\n * console.log(lchObject); // Output: { l: 54.66, c: 76.91, h: 217.76 }\n * ```\n */\nexport const toLCH = (\n color: MoebiusChromaColorInputType\n): MoebiusLCHObjectType => {\n return new UnitLCH(chroma(color).lch());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusLCHObjectType } from '../../types';\nimport { UnitOKLCH } from '../color-objects';\n\n/**\n * Converts a color to its OKLCH representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusLCHObjectType} The OKLCH representation of the input color.\n *\n * @example\n * ```ts\n * const oklchColor = toOKLCH('#3498db');\n * console.log(oklchColor); // Output: { l: 52.12, c: 126.62, h: 232.53 }\n * ```\n */\nexport const toOKLCH = (\n color: MoebiusChromaColorInputType\n): MoebiusLCHObjectType => {\n return new UnitOKLCH(chroma(color).oklch());\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusChromaColorInputType, MoebiusHSIObjectType } from '../../types';\nimport { UnitHSI } from '../color-objects';\n\n/**\n * Converts a color to its corresponding HSI object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @returns {MoebiusHSIObjectType} The HSI color representation object.\n *\n * @example\n * ```ts\n * const hsiObject = toHSI('#3498db');\n * console.log(hsiObject); // Output: { h: 207.76, s: 0.52, i: 0.4 }\n * ```\n */\nexport const toHSI = (\n color: MoebiusChromaColorInputType\n): MoebiusHSIObjectType => {\n return new UnitHSI(chroma(color).hsi());\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueRgbType\n} from '../../types';\n\n/**\n * Converts a color to its RGB representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in any valid chroma-js format.\n * @returns {MoebiusColorValueRgbType} The RGB representation of the input color.\n *\n * @example\n * ```ts\n * const rgbColor = toRGB('#3498db');\n * console.log(rgbColor); // Output: 'rgb(52, 152, 219)'\n * ```\n */\nexport const toRGB = (\n color: MoebiusChromaColorInputType\n): MoebiusColorValueRgbType => {\n const [r, g, b] = chroma(color).rgb();\n\n return `rgb(${r}, ${g}, ${b})`;\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusHSLObjectType,\n MoebiusRGBObjectType\n} from '../../types';\n\n/**\n * Converts a color to its corresponding object representation.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in hex format.\n * @param {string} [type] - The type of representation ('hsl' or undefined for RGB).\n * @returns {MoebiusRGBObjectType | MoebiusHSLObjectType} The color representation object.\n *\n * @example\n * ```ts\n * const rgbObject = toObject('#3498db');\n * console.log(rgbObject); // Output: { r: 52, g: 152, b: 219 }\n *\n * const hslObject = toObject('#3498db', 'hsl');\n * console.log(hslObject); // Output: { h: 207, s: 79, l: 57 }\n * ```\n */\nexport const toObject = (\n color: MoebiusChromaColorInputType,\n type?: string\n): MoebiusRGBObjectType | MoebiusHSLObjectType => {\n if (type === 'hsl') {\n const [h, s, l] = chroma(color).hsl();\n\n return {\n h: Number(!isNaN(h) ? h.toFixed(0) : 0),\n s: Number((s * 100).toFixed()),\n l: Number((l * 100).toFixed())\n };\n }\n\n const rgb = chroma(color).rgb();\n const rgbObject = {\n r: rgb[0],\n g: rgb[1],\n b: rgb[2]\n };\n\n return rgbObject;\n};\n","import { MoebiusPaletteDefaultOptionsType } from '../types';\n\n/**\n * Default options for the Moebius Palette.\n *\n * @type {MoebiusPaletteDefaultOptionsType}\n * @readonly\n *\n * @example\n * ```ts\n * console.log(MOEBIUS_PALETTE_DEFAULT_OPTIONS);\n * // {\n * // diverging: false,\n * // bezier: false,\n * // randomOffset: false,\n * // correctLightness: false,\n * // noDuplicates: true,\n * // colorScaleMode: 'lch',\n * // reverseDirection: false\n * // }\n * ```\n */\nexport const MOEBIUS_PALETTE_DEFAULT_OPTIONS: MoebiusPaletteDefaultOptionsType =\n {\n diverging: false,\n bezier: false,\n randomOffset: false,\n correctLightness: false,\n noDuplicates: true,\n colorScaleMode: 'lch',\n reverseDirection: false\n };\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\n/**\n * Generate a harmonized color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the harmonized palette.\n * @param {number} start - The starting angle for generating harmonized colors (degrees).\n * @param {number} end - The ending angle for generating harmonized colors (degrees).\n * @param {number} interval - The interval between harmonized colors (degrees).\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {boolean} [options.noDuplicates=true] - Whether to remove duplicate colors in the palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the harmonized palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const harmonizedPalette = harmonize(baseColor, 30, 210, 30, { noDuplicates: true });\n * console.log(harmonizedPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#3498db']\n * ```\n */\nexport const harmonize = (\n color: MoebiusChromaColorInputType,\n start: number,\n end: number,\n interval: number,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const { noDuplicates = true } = options;\n // Initialize the array with the base color.\n const colors = [chroma(color).hex()];\n\n // Convert the HSL color to an object for easy manipulation.\n let [h, s, l] = chroma(color).hsl();\n\n if (isNaN(h)) {\n h = 0;\n }\n\n s = Number((s * 100).toFixed());\n l = Number((l * 100).toFixed());\n\n // Generate harmonized colors within the specified range.\n for (let i = start; i <= end; i += interval) {\n // Calculate the adjusted hue.\n const h1 = Number(((h + i) % 360).toFixed());\n\n // Create the harmonized color in HSL format and add it to the array.\n colors.push(chroma(`hsl(${h1}, ${s}%, ${l}%)`).hex());\n }\n\n let uniqueColors = colors;\n\n if (noDuplicates) {\n uniqueColors = [...new Set(colors)];\n }\n\n return uniqueColors;\n};\n","/**\n * Generates a random integer within a specified range.\n *\n * @param {number} max - The maximum value (inclusive) for the random number.\n * @param {number} min - The minimum value (inclusive) for the random number.\n * @returns {number} - A random integer within the specified range.\n *\n * @example\n * ```ts\n * // Generate a random integer between 1 and 10, inclusive\n * const randomNumber = random(10, 1);\n * console.log(randomNumber); // Example output: 5\n * ```\n */\nexport const random = (max: number, min: number): number =>\n Math.floor(Math.random() * (max - min + 1)) + min;\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusColorValueHslType,\n MoebiusPaletteOptionsType\n} from '../types';\nimport { random } from '../utils/random';\n\n/**\n * Generates a monochromatic color palette based on the given color.\n * @param {MoebiusChromaColorInputType} color - The base color for the palette.\n * @param {MoebiusPaletteOptionsType} options - Options for generating the palette.\n * @returns {MoebiusColorValueHexType[]} - An array of hex color values in the palette.\n * @example\n * ```typescript\n * const baseColor = '#003f5c';\n * const options = { numberOfColors: 5, bezier: true, randomOffset: false };\n * const monochromaticPalette = monochromatic(baseColor, options);\n * console.log(monochromaticPalette);\n * [\n * '#003f5c', // maniacMansion,\n * '#014268', // darkImperialBlue,\n * '#024575', // macraggeBlue,\n * '#044784', // bridgeport,\n * '#064898', // frightNight,\n * '#0745b6', // absoluteZero,\n * '#002df5', // blueBouquet\n * ];\n * ```\n */\nexport const monochromatic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n bezier = false,\n randomOffset = false,\n colorScaleMode,\n noDuplicates = true,\n reverseDirection = false,\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n let [h, s, l] = chroma(color).hsl();\n\n if (isNaN(h)) {\n h = 0;\n }\n\n h = Number(h.toFixed(0));\n s = Number((s * 100).toFixed(0));\n l = Number((l * 100).toFixed(0));\n\n const hslColors: MoebiusColorValueHslType[] = [];\n\n hslColors.push(chroma(`hsl(${h}, ${s}%, ${l < 0 ? 0 : l}%)`).hex());\n\n if (randomOffset) {\n // because we've already added the original color, we start counting from 1\n for (let i = 1; i < numberOfColors; i++) {\n if (reverseDirection) {\n l += random(0, 10);\n h += random(-5, 5);\n } else {\n l -= random(0, 10);\n h -= random(-5, 5);\n }\n\n if (h > 359) h = 359;\n\n if (h < 0) h = 0;\n\n hslColors.push(chroma(`hsl(${h}, ${s}%, ${l < 0 ? 0 : l}%)`).hex());\n }\n } else {\n for (let i = 1; i < numberOfColors; i++) {\n if (reverseDirection) {\n l += 5;\n h += 5;\n } else {\n l -= 5;\n h -= 5;\n }\n\n if (h > 359) h = 359;\n\n if (h < 0) h = 0;\n\n hslColors.push(chroma(`hsl(${h}, ${s}%, ${l < 0 ? 0 : l}%)`).hex());\n }\n }\n\n let colors = hslColors.map((color) => chroma(color).hex());\n\n if (noDuplicates) {\n colors = [...new Set(colors)];\n }\n\n if (bezier) {\n if (colors.length > 1) {\n colors = chroma\n .bezier(colors)\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n } else {\n colors = chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n }\n }\n\n return colors;\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType,\n MoebiusChromaColorInputType\n} from '../types';\nimport { range } from '../utils/range';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a luminance shift palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the luminance shift palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {boolean} [options.diverging=false] - Whether to generate a diverging palette.\n * @param {number} [options.numberOfColors=7] - The number of colors in the luminance shift palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the luminance shift palette.\n * @private\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const luminanceShiftPalette = generateLuminanceShiftPalette(baseColor, { numberOfColors: 5 });\n * console.log(luminanceShiftPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\nconst generateLuminanceShiftPalette = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n) => {\n if (!color) throw Error('MoebiusPalettes: missing input `color`');\n\n const { diverging = false, numberOfColors = 7 } =\n options as MoebiusPaletteOptionsType;\n const [l, a, b] = chroma(color).lab();\n const lRange = 100 * (0.95 - 1 / numberOfColors);\n const lStep = lRange / (numberOfColors - 1);\n const lStart = (100 - lRange) * 0.5;\n const colorRange = range(lStart, lStart + numberOfColors * lStep, lStep);\n\n let offset = 0;\n\n if (!diverging) {\n offset = 9999;\n for (let i = 0; i < numberOfColors; i++) {\n const diff = l - colorRange[i];\n\n if (Math.abs(diff) < Math.abs(offset)) {\n offset = diff;\n }\n }\n }\n\n return colorRange.map((l) => chroma.lab([l + offset, a, b]).hex());\n};\n/**\n * Generate an array of auto colors for luminance shift based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating auto colors.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the auto colors.\n * @param {number} [options.numberOfColors] - The number of auto colors to generate.\n * @param {boolean} [options.reverseDirection=false] - Whether to reverse the order of generated colors.\n * @param {boolean} [options.diverging=false] - Whether to generate diverging auto colors.\n * @param {string} [options.divergentColor] - The divergent color to include in the palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the auto colors.\n * @private\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const autoColors = luminanceShiftAutoColors(baseColor, { numberOfColors: 5 });\n * console.log(autoColors); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\nconst luminanceShiftAutoColors = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n) => {\n const {\n numberOfColors,\n reverseDirection = false,\n diverging = false,\n divergentColor\n } = options;\n\n if (diverging) {\n const colors = generateLuminanceShiftPalette(chroma(color).hex(), {\n numberOfColors: Math.ceil((numberOfColors as number) / 2)\n }).concat(divergentColor);\n\n if (reverseDirection) colors.reverse();\n\n return colors;\n } else {\n return generateLuminanceShiftPalette(color, { numberOfColors });\n }\n};\n\n/**\n * Generate a luminance shift palette based on an array of colors, with optional diverging colors.\n *\n * @param {MoebiusChromaColorInputType[]} colors - Array of base colors for generating the luminance shift palette.\n * @param {MoebiusChromaColorInputType[]} [divergingColors=[]] - Array of diverging colors.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The total number of colors in the luminance shift palette.\n * @param {boolean} [options.diverging=false] - Whether to generate a diverging palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation.\n * @param {string} [options.divergentColor='#f5f5f5'] - The divergent color for a diverging palette.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the luminance shift palette.\n *\n * @example\n * ```ts\n * const baseColors = ['#3498db', '#99db34'];\n * const divergingColors = ['#db3434'];\n * const luminanceShiftPalette = luminanceShift(baseColors, divergingColors, { numberOfColors: 5 });\n * console.log(luminanceShiftPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\nexport const luminanceShift = (\n colors: MoebiusChromaColorInputType[],\n divergingColors: MoebiusChromaColorInputType[] = [],\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n diverging = false,\n colorScaleMode,\n bezier = false,\n divergentColor = '#f5f5f5',\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n divergingColors =\n divergingColors.length === 0\n ? [harmonize(colors[0], 90, 270, 90)[3]]\n : divergingColors;\n\n const even = numberOfColors % 2 === 0;\n const numberOfColorsLeft = diverging\n ? Math.ceil(numberOfColors / 2) + (even ? 1 : 0)\n : numberOfColors;\n const numberOfColorsRight = diverging\n ? Math.ceil(numberOfColors / 2) + (even ? 1 : 0)\n : 0;\n const generatedColors =\n colors.length !== 1\n ? colors\n : luminanceShiftAutoColors(colors[0], {\n numberOfColors: numberOfColorsLeft,\n divergentColor\n });\n\n let generatedDivergentColors: string[] = [];\n\n if (diverging) {\n generatedDivergentColors =\n divergingColors.length !== 1\n ? divergingColors\n : luminanceShiftAutoColors(divergingColors[0], {\n numberOfColors: numberOfColorsRight,\n divergentColor,\n reverse: false,\n diverging\n });\n }\n\n let stepsLeft = colors.length\n ? chroma\n .scale(generatedColors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColorsLeft)\n : [];\n\n if (bezier) {\n stepsLeft = colors.length\n ? chroma\n .bezier(generatedColors)\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColorsLeft)\n : [];\n }\n\n let stepsRight =\n diverging && divergingColors.length\n ? chroma\n .scale(generatedDivergentColors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColorsRight)\n : [];\n\n if (bezier) {\n stepsRight =\n diverging && divergingColors.length\n ? chroma\n .bezier(generatedDivergentColors)\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColorsRight)\n : [];\n }\n\n let steps = stepsLeft;\n\n steps = (\n diverging\n ? stepsLeft.slice(\n 0,\n stepsLeft.length - (numberOfColorsLeft % 2 !== 0 ? 0 : 1)\n )\n : stepsLeft\n )\n //).concat(stepsRight.slice(1).reverse());\n .concat(stepsRight.reverse());\n\n return steps;\n};\n","/**\n * Generates an array of numbers within a specified range with a given interval.\n * @param {number} start - The starting value of the range.\n * @param {number} stop - The stopping value of the range.\n * @param {number} interval - The interval between numbers in the range.\n * @returns {number[]} - An array of numbers in the specified range.\n * @example\n * ```ts\n * const result = range(1, 10, 2);\n * console.log(result); // [1, 3, 5, 7, 9]\n * ```\n */\nexport const range = (\n start: number,\n stop: number,\n interval: number\n): number[] => {\n const a: number[] = [];\n\n for (let i = start; i < stop; i += interval) {\n a.push(i);\n }\n\n return a;\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusColorValueHexType, MoebiusPaletteOptionsType } from '../types';\n\n/**\n * Generates a color scale using Chroma.js's bezier interpolation.\n * @param {MoebiusColorValueHexType[]} colors - The input colors for the bezier interpolation.\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} [options={}] - Options for generating the color scale.\n * @param {number} [options.numberOfColors=8] - The number of colors in the resulting scale.\n * @param {string} [options.colorScaleMode] - The color scale mode for Chroma.js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the color scale.\n * @returns {MoebiusColorValueHexType[]} - The generated color scale.\n * @example\n * ```ts\n * const inputColors = ['#3498db', '#2ecc71', '#e74c3c'];\n * const options = { numberOfColors: 5, colorScaleMode: 'lch', correctLightness: false };\n * const scaleColors = getChromaBezierScaleColors(inputColors, options);\n * console.log(scaleColors);\n * ```\n */\nexport const getChromaBezierScaleColors = (\n colors: MoebiusColorValueHexType[],\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n) => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n try {\n return chroma\n .bezier(colors)\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n } catch {\n return [];\n }\n};\n","import chroma from 'chroma-js';\n\nimport { MoebiusColorValueHexType, MoebiusPaletteOptionsType } from '../types';\n\n/**\n * Generates a color scale using Chroma.js.\n * @param {MoebiusColorValueHexType[]} colors - The input colors for the color scale.\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} [options={}] - Options for generating the color scale.\n * @param {number} [options.numberOfColors=8] - The number of colors in the resulting scale.\n * @param {string} [options.colorScaleMode] - The color scale mode for Chroma.js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the color scale.\n * @returns {MoebiusColorValueHexType[]} - The generated color scale.\n * @example\n * ```ts\n * const inputColors = ['#3498db', '#2ecc71', '#e74c3c'];\n * const options = { numberOfColors: 5, colorScaleMode: 'lch', correctLightness: false };\n * const scaleColors = getChromaScaleColors(inputColors, options);\n * console.log(scaleColors);\n * ```\n */\nexport const getChromaScaleColors = (\n colors: MoebiusColorValueHexType[],\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n) => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n try {\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n } catch {\n return [];\n }\n};\n","/* eslint-disable @stylistic/indent */\nimport { monochromatic } from '../features';\nimport {\n MoebiusColorValueHexType,\n MoebiusPaletteAccentColorsInterface,\n MoebiusPaletteColorsInterface,\n MoebiusPaletteOptionsType\n} from '../types';\n\n/**\n * Class representing a set of accent colors in various palettes.\n */\nexport class MoebiusAccentColors\n implements MoebiusPaletteAccentColorsInterface\n{\n interpolate: MoebiusColorValueHexType[][];\n luminanceShift: MoebiusColorValueHexType[][];\n monochromatic: MoebiusColorValueHexType[][];\n complement: MoebiusColorValueHexType[][];\n split: MoebiusColorValueHexType[][];\n triadic: MoebiusColorValueHexType[][];\n tetradic: MoebiusColorValueHexType[][];\n pentadic: MoebiusColorValueHexType[][];\n hexadic: MoebiusColorValueHexType[][];\n analogous: MoebiusColorValueHexType[][];\n\n /**\n * Creates an instance of MoebiusAccentColors.\n * @param {MoebiusPaletteColorsInterface} colors - Base colors for accent palettes.\n * @param {MoebiusPaletteOptionsType} options - Options for generating accent palettes.\n * @example\n * ```ts\n * const colors = {\n * monochromatic: ['#ff0000', '#00ff00'],\n * // other base palettes...\n * };\n * const options = { baseColor: { color: '#ff0000', name: 'Red', hex: '#ff0000' }, numberOfColors: 9 };\n * const accentColors = new MoebiusAccentColors(colors, options);\n * ```\n */\n constructor(\n colors: MoebiusPaletteColorsInterface,\n options: MoebiusPaletteOptionsType\n ) {\n Object.keys(colors).forEach((palette) => {\n this[palette] = colors[palette].map((color: MoebiusColorValueHexType) =>\n monochromatic(color, { ...options, numberOfColors: 9 })\n );\n });\n }\n /**\n * Converts the accent palettes to a flat array.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values.\n * @example\n * ```ts\n * const accentColors = new MoebiusAccentColors(baseColors, options);\n * const flatArray = accentColors.toArray();\n * console.log(flatArray); // ['#ff0000', '#00ff00', ...]\n * ```\n */\n toArray(): MoebiusColorValueHexType[] {\n return [\n ...this.interpolate,\n ...this.luminanceShift,\n ...this.monochromatic,\n ...this.complement,\n ...this.split,\n ...this.triadic,\n ...this.tetradic,\n ...this.pentadic,\n ...this.hexadic,\n ...this.analogous\n ].flat();\n }\n}\n","import {\n MoebiusColorValueHexType,\n MoebiusPaletteColorsInterface\n} from '../types';\n\n/**\n * Class representing a set of colors in various palettes.\n */\nexport class MoebiusPaletteColors implements MoebiusPaletteColorsInterface {\n interpolate: MoebiusColorValueHexType[];\n luminanceShift: MoebiusColorValueHexType[];\n monochromatic: MoebiusColorValueHexType[];\n complement: MoebiusColorValueHexType[];\n split: MoebiusColorValueHexType[];\n triadic: MoebiusColorValueHexType[];\n tetradic: MoebiusColorValueHexType[];\n pentadic: MoebiusColorValueHexType[];\n hexadic: MoebiusColorValueHexType[];\n analogous: MoebiusColorValueHexType[];\n\n /**\n * Creates an instance of MoebiusPaletteColors.\n * @param {MoebiusPaletteColorsInterface} colors - Palette colors to initialize with.\n * @example\n * ```ts\n * const colors = {\n * interpolate: ['#ff0000', '#00ff00'],\n * // other palettes...\n * };\n * const palette = new MoebiusPaletteColors(colors);\n * ```\n */\n constructor(colors: MoebiusPaletteColorsInterface) {\n Object.keys(colors).forEach((palette) => {\n this[palette] = colors[palette];\n });\n }\n\n /**\n * Converts the palettes to a flat array.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values.\n * @example\n * ```ts\n * const palette = new MoebiusPaletteColors({ interpolate: ['#ff0000', '#00ff00'] });\n * const flatArray = palette.toArray();\n * console.log(flatArray); // ['#ff0000', '#00ff00']\n * ```\n */\n toArray(): MoebiusColorValueHexType[] {\n return [\n ...this.interpolate,\n ...this.luminanceShift,\n ...this.monochromatic,\n ...this.complement,\n ...this.split,\n ...this.triadic,\n ...this.tetradic,\n ...this.pentadic,\n ...this.hexadic,\n ...this.analogous\n ].flat();\n }\n}\n","import {\n MoebiusColorValueHexType,\n MoebiusThemeColorsInterface\n} from '../types';\n\n/**\n * Class representing a set of colors in various themes.\n */\nexport class MoebiusThemeColors implements MoebiusThemeColorsInterface {\n darkMode: Record<string, MoebiusColorValueHexType[]>;\n\n /**\n * Creates an instance of MoebiusThemeColors.\n * @param {MoebiusThemeColorsInterface} colors - Palette colors to initialize with.\n * @example\n * ```ts\n * const colors = {\n * interpolate: ['#ff0000', '#00ff00'],\n * // other themes...\n * };\n * const theme = new MoebiusThemeColors(colors);\n * ```\n */\n constructor(colors: MoebiusThemeColorsInterface) {\n Object.keys(colors).forEach((theme) => {\n this[theme] = colors[theme];\n });\n }\n}\n","import { MOEBIUS_PALETTE_DEFAULT_OPTIONS } from '../constants';\nimport * as FEATURES from '../features';\nimport {\n MoebiusColorValueHexType,\n MoebiusColorInterface,\n MoebiusPaletteAccentColorsInterface,\n MoebiusPaletteColorsInterface,\n MoebiusPaletteDefaultOptionsType,\n MoebiusPaletteOptionsType,\n MoebiusPaletteInterface,\n MoebiusChromaColorInputType,\n MoebiusThemeColorsInterface\n} from '../types';\n\nimport { MoebiusAccentColors } from './MoebiusAccentColors';\nimport { MoebiusPaletteColors } from './MoebiusPaletteColors';\nimport { MoebiusThemeColors } from './MoebiusThemeColors';\n\n/**\n * MoebiusPalettes class representing a set of color palettes and their variations.\n *\n */\nexport class MoebiusPalettes implements MoebiusPaletteInterface {\n baseColor: MoebiusColorInterface;\n secondaryColor: MoebiusColorInterface;\n colors: Record<string, unknown> | MoebiusPaletteColorsInterface = {};\n themes: Record<string, unknown> | MoebiusThemeColorsInterface = {};\n defaultOptions: MoebiusPaletteDefaultOptionsType = {\n ...MOEBIUS_PALETTE_DEFAULT_OPTIONS,\n divergentColor: '#f5f5f5'\n };\n options: MoebiusPaletteOptionsType;\n all: MoebiusColorValueHexType[] = [];\n accents: MoebiusPaletteAccentColorsInterface;\n\n /**\n * Creates an instance of MoebiusPalettes.\n * @param {MoebiusPaletteOptionsType} options - Options for configuring the palettes.\n */\n constructor(options: MoebiusPaletteOptionsType) {\n this.options = { ...this.defaultOptions, ...options };\n this.baseColor = this.options.baseColor;\n this.secondaryColor = this.options.secondaryColor;\n this.themes = new MoebiusThemeColors({\n darkMode: this.darkMode(this.baseColor.hex, this.secondaryColor.hex, {\n ...this.options,\n reverseDirection: !this.options.reverseDirection\n })\n });\n this.colors = new MoebiusPaletteColors({\n interpolate: this.interpolate(\n this.baseColor.hex,\n this.secondaryColor.hex,\n this.options\n ),\n luminanceShift: this.luminanceShift(\n [this.baseColor.hex],\n [this.secondaryColor.hex],\n this.options\n ),\n monochromatic: this.monochromatic(this.baseColor.hex),\n complement: this.complement(this.baseColor.hex),\n split: this.split(this.baseColor.hex),\n triadic: this.triadic(this.baseColor.hex),\n tetradic: this.tetradic(this.baseColor.hex),\n pentadic: this.pentadic(this.baseColor.hex),\n hexadic: this.hexadic(this.baseColor.hex),\n analogous: this.analogous(this.baseColor.hex)\n });\n\n this.accents = new MoebiusAccentColors(this.colors, this.options);\n\n this.all = [\n ...new Set(\n [\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(this.accents as any).toArray(),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ...(this.colors as any).toArray()\n ].flat()\n )\n ];\n }\n\n /**\n * Generate a complement color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the complement palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.<\n * @param {number} [options.numberOfColors=8] - The number of colors in the complement palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the complement palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const complementPalette = complement(baseColor, { numberOfColors: 5 });\n * console.log(complementPalette); // ['#3498db', '#db3434', '#75db34', '#dbd134', '#db7434']\n * ```\n */\n complement(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.complement(color, currentOptions);\n }\n\n /**\n * Generates a dark mode color palette based on the provided base and secondary colors.\n * @param {MoebiusChromaColorInputType} baseColor - The base color for the palette.\n * @param {MoebiusChromaColorInputType} secondaryColor - The secondary color for the palette.\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} [options={}] - Palette options.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation for color scales.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma.mix.\n * @param {boolean} [options.noDuplicates=true] - Whether to remove duplicate colors from the palette.\n * @returns {Record<string, MoebiusColorValueHexType[]>} - The generated dark mode color palette.\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const secondaryColor = '#2ecc71';\n * const options = { bezier: true, colorScaleMode: 'lch' };\n * const palette = darkMode(baseColor, secondaryColor, options);\n * console.log(palette);\n * ```\n */\n darkMode(\n baseColor: MoebiusChromaColorInputType,\n secondaryColor: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): Record<string, MoebiusColorValueHexType[]> {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.darkMode(baseColor, secondaryColor, currentOptions);\n }\n\n /**\n * Generate a split color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the split palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the split palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the split palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const splitPalette = split(baseColor, { numberOfColors: 5 });\n * console.log(splitPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\n split(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.split(color, currentOptions);\n }\n\n /**\n * Generates a triadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in various formats (HEX, RGB, HSL, etc.).\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} options - Additional options for palette generation.\n * @param {number} [options.numberOfColors=8] - The number of colors in the generated palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for the generated palette.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} An array of HEX values representing the triadic color palette.\n *\n * @example\n * ```ts\n * const triadicPalette = triadic('#3498db', { numberOfColors: 5 });\n * console.log(triadicPalette);\n * // Output: ['#3498db', '#db344f', '#4fdb34', '#9834db', '#34db98']\n * ```\n */\n triadic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.triadic(color, currentOptions);\n }\n\n /**\n * Generate a tetradic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the tetradic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the tetradic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the tetradic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const tetradicPalette = tetradic(baseColor, { numberOfColors: 5 });\n * console.log(tetradicPalette); // ['#3498db', '#db3434', '#34db99', '#dbd134', '#8f34db']\n * ```\n */\n tetradic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.tetradic(color, currentOptions);\n }\n\n /**\n * Generate a pentadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the pentadic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the pentadic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the pentadic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const pentadicPalette = pentadic(baseColor, { numberOfColors: 5 });\n * console.log(pentadicPalette); // ['#3498db', '#dbd134', '#db3434', '#34db99', '#8f34db']\n * ```\n */\n pentadic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.pentadic(color, currentOptions);\n }\n\n /**\n * Generate a hexadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the hexadic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the hexadic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the hexadic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const hexadicPalette = hexadic(baseColor, { numberOfColors: 5 });\n * console.log(hexadicPalette); // ['#3498db', '#5d7f33', '#8473a9', '#ad7a95', '#db3434']\n * ```\n */\n hexadic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.hexadic(color, currentOptions);\n }\n\n /**\n * Generate an analogous color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the analogous palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the analogous palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the analogous palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const analogousPalette = analogous(baseColor, { numberOfColors: 5 });\n * console.log(analogousPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#db3474']\n * ```\n */\n analogous(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.analogous(color, currentOptions);\n }\n\n /**\n * Interpolate between two colors and generate a color palette.\n *\n * @param {MoebiusChromaColorInputType} primaryColor - The starting color for interpolation.\n * @param {MoebiusChromaColorInputType} secondaryColor - The ending color for interpolation.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the interpolated palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the interpolated palette.\n *\n * @example\n * ```ts\n * const startColor = '#3498db';\n * const endColor = '#db3434';\n * const interpolatedPalette = interpolate(startColor, endColor, { numberOfColors: 5 });\n * console.log(interpolatedPalette); // ['#3498db', '#5d6d7e', '#8473a9', '#ad7a95', '#db3434']\n * ```\n */\n interpolate(\n primaryColor: MoebiusColorValueHexType,\n secondaryColor: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.interpolate(primaryColor, secondaryColor, currentOptions);\n }\n /**\n * Generate a luminance shift palette based on an array of colors, with optional diverging colors.\n *\n * @param {MoebiusChromaColorInputType[]} colors - Array of base colors for generating the luminance shift palette.\n * @param {MoebiusChromaColorInputType[]} [divergingColors=[]] - Array of diverging colors.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The total number of colors in the luminance shift palette.\n * @param {boolean} [options.diverging=false] - Whether to generate a diverging palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation.\n * @param {string} [options.divergentColor='#f5f5f5'] - The divergent color for a diverging palette.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the luminance shift palette.\n *\n * @example\n * ```ts\n * const baseColors = ['#3498db', '#99db34'];\n * const divergingColors = ['#db3434'];\n * const luminanceShiftPalette = luminanceShift(baseColors, divergingColors, { numberOfColors: 5 });\n * console.log(luminanceShiftPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\n luminanceShift(\n colors: MoebiusColorValueHexType[],\n divergingColors: MoebiusColorValueHexType[] = [],\n\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.luminanceShift(colors, divergingColors, currentOptions);\n }\n\n /**\n * Generates a monochromatic color palette based on the given color.\n * @param {MoebiusChromaColorInputType} color - The base color for the palette.\n * @param {MoebiusPaletteOptionsType} options - Options for generating the palette.\n * @returns {MoebiusColorValueHexType[]} - An array of hex color values in the palette.\n * @example\n * ```typescript\n * const baseColor = '#003f5c';\n * const options = { numberOfColors: 5, bezier: true, randomOffset: false };\n * const monochromaticPalette = monochromatic(baseColor, options);\n * console.log(monochromaticPalette);\n * [\n * '#003f5c', // maniacMansion,\n * '#014268', // darkImperialBlue,\n * '#024575', // macraggeBlue,\n * '#044784', // bridgeport,\n * '#064898', // frightNight,\n * '#0745b6', // absoluteZero,\n * '#002df5', // blueBouquet\n * ];\n * ```\n */\n monochromatic(\n color: MoebiusColorValueHexType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.monochromatic(color, currentOptions);\n }\n /**\n * Generate a harmonized color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the harmonized palette.\n * @param {number} start - The starting angle for generating harmonized colors (degrees).\n * @param {number} end - The ending angle for generating harmonized colors (degrees).\n * @param {number} interval - The interval between harmonized colors (degrees).\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {boolean} [options.noDuplicates=true] - Whether to remove duplicate colors in the palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the harmonized palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const harmonizedPalette = harmonize(baseColor, 30, 210, 30, { noDuplicates: true });\n * console.log(harmonizedPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#3498db']\n * ```\n */\n harmonize(\n color: MoebiusColorValueHexType,\n start: number,\n end: number,\n interval: number,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n ): MoebiusColorValueHexType[] {\n const currentOptions = { ...this.options, ...options };\n\n return FEATURES.harmonize(color, start, end, interval, currentOptions);\n }\n}\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a complement color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the complement palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the complement palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the complement palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const complementPalette = complement(baseColor, { numberOfColors: 5 });\n * console.log(complementPalette); // ['#3498db', '#db3434', '#75db34', '#dbd134', '#db7434']\n * ```\n */\nexport const complement = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a complement color scheme.\n const colors = harmonize(color, 180, 180, 1);\n\n // Use chroma-js to fill in missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\nimport { getChromaBezierScaleColors } from '../utils/get-chroma-bezier-scale-colors';\nimport { getChromaScaleColors } from '../utils/get-chroma-scale-colors';\n\nimport { monochromatic } from './monochromatic';\n\n/**\n * Generates a dark mode color palette based on the provided base and secondary colors.\n * @param {MoebiusChromaColorInputType} baseColor - The base color for the palette.\n * @param {MoebiusChromaColorInputType} secondaryColor - The secondary color for the palette.\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} [options={}] - Palette options.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation for color scales.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma.mix.\n * @param {boolean} [options.noDuplicates=true] - Whether to remove duplicate colors from the palette.\n * @returns {Record<string, MoebiusColorValueHexType[]>} - The generated dark mode color palette.\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const secondaryColor = '#2ecc71';\n * const options = { bezier: true, colorScaleMode: 'lch' };\n * const palette = darkMode(baseColor, secondaryColor, options);\n * console.log(palette);\n * ```\n */\nexport const darkMode = (\n baseColor: MoebiusChromaColorInputType,\n secondaryColor: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): Record<string, MoebiusColorValueHexType[]> => {\n const {\n bezier = false,\n colorScaleMode,\n noDuplicates = true\n } = options as MoebiusPaletteOptionsType;\n const ratio = 0.99;\n const ratioMultiplier = 0.02;\n const primaryAccents = monochromatic(baseColor, options);\n const surfaceAccents = monochromatic(secondaryColor, options);\n const mixedAccents = surfaceAccents.map((hex, index) => {\n return chroma\n .mix(\n primaryAccents[index],\n hex,\n ratio - index * ratioMultiplier,\n colorScaleMode\n )\n .hex();\n });\n const palette = {\n primary: primaryAccents,\n surface: surfaceAccents,\n mixed: mixedAccents\n };\n\n if (noDuplicates) {\n palette.primary = [...new Set(primaryAccents)];\n palette.surface = [...new Set(surfaceAccents)];\n palette.mixed = [...new Set(mixedAccents)];\n }\n\n if (bezier) {\n if (\n palette.primary.length > 1 &&\n palette.surface.length > 1 &&\n palette.mixed.length > 1\n ) {\n palette.primary = getChromaBezierScaleColors(palette.primary, options);\n palette.surface = getChromaBezierScaleColors(palette.surface, options);\n palette.mixed = getChromaBezierScaleColors(palette.mixed, options);\n } else {\n palette.primary = getChromaScaleColors(palette.primary, options);\n palette.surface = getChromaScaleColors(palette.surface, options);\n palette.mixed = getChromaScaleColors(palette.mixed, options);\n }\n }\n\n return palette;\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a split color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the split palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the split palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the split palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const splitPalette = split(baseColor, { numberOfColors: 5 });\n * console.log(splitPalette); // ['#3498db', '#99db34', '#dbd134', '#db3434', '#8f34db']\n * ```\n */\nexport const split = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a split color scheme.\n const colors = harmonize(color, 150, 210, 60);\n\n // Use chroma-js to fill in the missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generates a triadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The input color in various formats (HEX, RGB, HSL, etc.).\n * @param {Record<string, unknown> | MoebiusPaletteOptionsType} options - Additional options for palette generation.\n * @param {number} [options.numberOfColors=8] - The number of colors in the generated palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for the generated palette.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} An array of HEX values representing the triadic color palette.\n *\n * @example\n * ```ts\n * const triadicPalette = triadic('#3498db', { numberOfColors: 5 });\n * console.log(triadicPalette);\n * // Output: ['#3498db', '#db344f', '#4fdb34', '#9834db', '#34db98']\n * ```\n */\nexport const triadic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n const colors = harmonize(color, 120, 240, 120);\n\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a tetradic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the tetradic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the tetradic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the tetradic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const tetradicPalette = tetradic(baseColor, { numberOfColors: 5 });\n * console.log(tetradicPalette); // ['#3498db', '#db3434', '#34db99', '#dbd134', '#8f34db']\n * ```\n */\nexport const tetradic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a tetradic color scheme.\n const colors = harmonize(color, 90, 270, 90);\n\n // Use chroma-js to fill in the missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a pentadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the pentadic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the pentadic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the pentadic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const pentadicPalette = pentadic(baseColor, { numberOfColors: 5 });\n * console.log(pentadicPalette); // ['#3498db', '#dbd134', '#db3434', '#34db99', '#8f34db']\n * ```\n */\nexport const pentadic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a pentadic color scheme.\n const colors = harmonize(color, 144, 360, 72);\n\n // Use chroma-js to fill in colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate a hexadic color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the hexadic palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the hexadic palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the hexadic palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const hexadicPalette = hexadic(baseColor, { numberOfColors: 5 });\n * console.log(hexadicPalette); // ['#3498db', '#5d7f33', '#8473a9', '#ad7a95', '#db3434']\n * ```\n */\nexport const hexadic = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate a hexadic color scheme.\n const colors = harmonize(color, 120, 360, 60);\n\n // Use chroma-js to fill in missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\nimport { harmonize } from './harmonize';\n\n/**\n * Generate an analogous color palette based on the input color.\n *\n * @param {MoebiusChromaColorInputType} color - The base color for generating the analogous palette.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the analogous palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the analogous palette.\n *\n * @example\n * ```ts\n * const baseColor = '#3498db';\n * const analogousPalette = analogous(baseColor, { numberOfColors: 5 });\n * console.log(analogousPalette); // ['#3498db', '#75db34', '#dbd134', '#db7434', '#db3474']\n * ```\n */\nexport const analogous = (\n color: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n correctLightness = true\n } = options;\n // Generate an analogous color scheme.\n const colors = harmonize(color, 30, 90, 30);\n\n // Use chroma-js to fill in the missing colors for the palette.\n return chroma\n .scale(colors)\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n};\n","import chroma from 'chroma-js';\n\nimport {\n MoebiusChromaColorInputType,\n MoebiusColorValueHexType,\n MoebiusPaletteOptionsType\n} from '../types';\n\n/**\n * Interpolate between two colors and generate a color palette.\n *\n * @param {MoebiusChromaColorInputType} primaryColor - The starting color for interpolation.\n * @param {MoebiusChromaColorInputType} secondaryColor - The ending color for interpolation.\n * @param {MoebiusPaletteOptionsType} [options={}] - Options for generating the palette.\n * @param {number} [options.numberOfColors=8] - The number of colors in the interpolated palette.\n * @param {string} [options.colorScaleMode] - The color scale mode for chroma-js.\n * @param {boolean} [options.bezier=false] - Whether to use bezier interpolation.\n * @param {boolean} [options.correctLightness=true] - Whether to correct lightness in the generated palette.\n * @returns {MoebiusColorValueHexType[]} - Array of hex color values representing the interpolated palette.\n *\n * @example\n * ```ts\n * const startColor = '#3498db';\n * const endColor = '#db3434';\n * const interpolatedPalette = interpolate(startColor, endColor, { numberOfColors: 5 });\n * console.log(interpolatedPalette); // ['#3498db', '#5d6d7e', '#8473a9', '#ad7a95', '#db3434']\n * ```\n */\nexport const interpolate = (\n primaryColor: MoebiusChromaColorInputType,\n secondaryColor: MoebiusChromaColorInputType,\n options: Record<string, unknown> | MoebiusPaletteOptionsType = {}\n): MoebiusColorValueHexType[] => {\n const {\n numberOfColors = 8,\n colorScaleMode,\n bezier = false,\n correctLightness = true\n } = options as MoebiusPaletteOptionsType;\n\n let colors = chroma\n .scale([primaryColor, secondaryColor])\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n\n if (bezier) {\n colors = chroma\n .bezier([primaryColor, secondaryColor])\n .scale()\n .mode(colorScaleMode)\n .correctLightness(correctLightness)\n .colors(numberOfColors);\n }\n\n return colors;\n};\n","import { MoebiusColorValueHexType } from '../types';\nimport { getStartMaskDegree } from '../utils/svg/get-start-mask-degree';\nimport { pieSlice } from '../utils/svg/pie-slice';\nimport { uniqueID } from '../utils/unique-id';\n\n/**\n * Helper class for generating SVG paths for colored pie slices.\n */\nexport class MoebiusSVGHelper {\n xlmns = 'http://www.w3.org/2000/svg';\n\n /**\n * Gets SVG paths for coloured pie slices based on the provided colors.\n * @param {MoebiusColorValueHexType[][]} colors - Array of color groups.\n * @param {number} [size=256] - Size of the SVG.\n * @returns {DocumentFragment} - Document fragment containing the SVG paths.\n * @example\n * ```ts\n * const svgHelper = new MoebiusSVGHelper();\n * const colors = [['#ff0000', '#00ff00'], ['#0000ff']];\n * const svgFragment = svgHelper.getColorPiePaths(colors, 256);\n * document.body.appendChild(svgFragment);\n * ```\n */\n getColorPiePaths(\n colors: MoebiusColorValueHexType[][],\n size: number = 256\n ): DocumentFragment {\n const df = document.createDocumentFragment();\n const defsElement = document.createElementNS(this.xlmns, 'defs');\n const maskElement = document.createElementNS(this.xlmns, 'mask');\n const rectElement = document.createElementNS(this.xlmns, 'rect');\n const gElement = document.createElementNS(this.xlmns, 'g');\n const interval = 360 / colors.length;\n const id = uniqueID();\n\n maskElement.setAttributeNS(null, 'id', id);\n rectElement.setAttributeNS(null, 'height', '100%');\n rectElement.setAttributeNS(null, 'width', '100%');\n rectElement.setAttributeNS(null, 'fill', 'white');\n gElement.setAttributeNS(null, 'mask', `url(#${id})`);\n maskElement.appendChild(rectElement);\n\n const maskDegrees = 360 / colors.length;\n const startMaskDegree = getStartMaskDegree(maskDegrees / 2, colors.length);\n\n for (let i = startMaskDegree; i < 360; i += maskDegrees) {\n const lineElement = document.createElementNS(this.xlmns, 'line');\n\n lineElement.setAttributeNS(null, 'x1', '128');\n lineElement.setAttributeNS(null, 'y1', '128');\n lineElement.setAttributeNS(null, 'x2', '0');\n lineElement.setAttributeNS(null, 'y2', '128');\n lineElement.setAttributeNS(null, 'stroke', 'black');\n lineElement.setAttributeNS(null, 'stroke-width', '6');\n lineElement.setAttributeNS(null, 'transform', `rotate(${i} 128 128)`);\n maskElement.appendChild(lineElement);\n }\n\n let start = 0;\n\n colors.forEach((group: string[]) => {\n const inwardInterval = size / 2 / group.length;\n\n start += interval;\n\n return group.forEach((color: MoebiusColorValueHexType, index: number) => {\n const r = size / 2 - index * inwardInterval;\n const path = document.createElementNS(this.xlmns, 'path');\n\n path.setAttributeNS(null, 'fill', color);\n path.setAttributeNS(null, 'data-color-hex', color);\n path.setAttributeNS(null, 'data-r', `${r}`);\n path.setAttributeNS(null, 'd', pieSlice(start, interval, r));\n gElement.appendChild(path);\n });\n });\n defsElement.appendChild(maskElement);\n df.appendChild(defsElement);\n df.appendChild(gElement);\n\n return df;\n }\n}\n","/**\n * Generates a unique identifier.\n * @returns {string} - A unique identifier.\n * @example\n * ```ts\n * const id = uniqueID();\n * console.log(id); // \"_abc123\"\n * ```\n */\nexport const uniqueID = (): string =>\n '_' + Math.random().toString(36).substring(2, 11);\n","/**\n * Calculates the starting mask degree based on the number of elements in a color group.\n *\n * @param {number} initial - The initial starting degree.\n * @param {number} length - The number of elements in the color group.\n * @returns {number} - The adjusted starting degree for creating a color mask.\n */\nexport const getStartMaskDegree = (initial: number, length: number): number => {\n if (length === 4 || length === 8 || length === 12) {\n return 0;\n } else if (length === 3 || length === 9) {\n return 30;\n } else if (length === 7) {\n return 12;\n } else if (length === 5) {\n return 55;\n }\n\n return initial;\n};\n","/**\n * Generates an SVG path representing a pie slice.\n *\n * @param {number} start - Starting angle of the pie slice in degrees.\n * @param {number} interval - Angular interval of the pie slice in degrees.\n * @param {number} radius - Radius of the circle.\n * @param {number} size - Size of the circle. Default is 256.\n * @returns {string} - SVG path representing the pie slice.\n */\nexport const pieSlice = (\n start: number,\n interval: number,\n radius: number,\n size: number = 256\n): string => {\n const centerX = size / 2; // X-coordinate of the circle's center\n const centerY = centerX; // Y-coordinate of the circle's center\n\n let stop = start + interval;\n\n // Ensure start is smaller than stop\n if (start > stop) {\n const temp = start;\n\n start = stop;\n stop = temp;\n }\n\n // Calculate start and end points\n const startX = centerX + radius * Math.cos((-start + 90) * (Math.PI / 180));\n const startY = centerY + radius * Math.sin((-start + 90) * (Math.PI / 180));\n const endX = centerX + radius * Math.cos((-stop + 90) * (Math.PI / 180));\n const endY = centerY + radius * Math.sin((-stop + 90) * (Math.PI / 180));\n const largeArcFlag = stop - start <= 180 ? '0' : '1';\n\n // Create the SVG path\n return `M ${startX} ${startY} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${endX} ${endY} L ${centerX} ${centerY} Z`;\n};\n","/* eslint-disable import/no-unused-modules */\nimport { isString } from '@phun-ky/typeof';\nimport chroma from 'chroma-js';\nimport nearestColor from 'nearest-color';\n\nimport { MoebiusColor } from './classes/MoebiusColor';\nimport { MoebiusPalettes } from './classes/MoebiusPalettes';\nimport { MoebiusSVGHelper } from './classes/MoebiusSVGHelper';\nimport {\n MoebiusColorValueHexType,\n NearestColorColorMatchInterface\n} from './types';\n\nexport * from './types';\n\nexport type MoebiusReturnType = Promise<{\n MoebiusColor: typeof MoebiusColor;\n MoebiusPalettes: typeof MoebiusPalettes;\n MoebiusSVGHelper: typeof MoebiusSVGHelper;\n}>;\n\nconst initializeColorNames = async (): Promise<\n (color: string) => NearestColorColorMatchInterface | string\n> => {\n const response = await fetch('https://color-names.herokuapp.com/v1/');\n const data = await response.json();\n const colors = data.colors;\n const map = {};\n\n colors.forEach((entry: Record<string, unknown>) => {\n map[entry.name as string] = entry.hex;\n });\n\n return nearestColor.from(map);\n};\n\n/**\n * Asynchronous function to initialize Moebius with required data\n * @function\n * @returns {MoebiusReturnType} An object with Moebius classes\n *\n */\nasync function Moebius(): MoebiusReturnType {\n const colorNames = await initializeColorNames();\n\n class MoebiusColorAbstract extends MoebiusColor {\n constructor(color: MoebiusColorValueHexType) {\n super(\n chroma(color).hex(),\n isString(colorNames(color))\n ? (colorNames(color) as string)\n : (colorNames(color) as NearestColorColorMatchInterface).name\n );\n }\n }\n\n return {\n MoebiusColor: MoebiusColorAbstract as typeof MoebiusColor,\n MoebiusPalettes,\n MoebiusSVGHelper\n };\n}\n\nexport default Moebius;\n","/**\n* @phun-ky/typeof\n* A set of JavaScript helper functions to check for types\n* @author Alexander Vassbotn Røyne-Helgesen <alexander@phun-ky.net>\n* @version 1.2.10\n* @license\n* Copyright (c) 2024 Alexander Vassbotn Røyne-Helgesen\n*\n* Permission is hereby granted, free of charge, to any person obtaining a copy\n* of this software and associated documentation files (the \"Software\"), to deal\n* in the Software without restriction, including without limitation the rights\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the Software is\n* furnished to do so, subject to the following conditions:\n*\n* The above copyright notice and this permission notice shall be included in all\n* copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n* SOFTWARE.\n*/\nconst t=t=>\"string\"==typeof t,r=r=>!t(r),e=t=>\"number\"==typeof t,o=t=>!e(t),n=t=>\"boolean\"==typeof t,c=t=>!n(t),p=t=>void 0===t,u=t=>!p(t),l=t=>{if(\"object\"!=typeof t||null===t)return!1;if(\"[object Object]\"!==Object.prototype.toString.call(t))return!1;const r=Object.getPrototypeOf(t);if(null===r)return!0;const e=Object.prototype.hasOwnProperty.call(r,\"constructor\")?r.constructor:null;return\"function\"==typeof e&&e instanceof e&&Function.prototype.call(e)===Function.prototype.call(t)},y=t=>{const r=typeof t;return null!==t&&(\"object\"===r||\"function\"===r)},f=t=>{if(\"function\"!=typeof t)return!1;if(i(t))return!1;try{const r=Object.getOwnPropertyDescriptor(t,\"prototype\");return!!r&&!r.writable}catch{return!1}},i=t=>{if(\"function\"!=typeof t)return!1;return[Object,Array,Function,String,Number,Boolean,Date,RegExp,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,Map,WeakMap,Set,WeakSet,Promise,BigInt,Symbol].includes(t)},a=t=>\"object\"==typeof t&&null!==t&&Object.getPrototypeOf(t)!==Object.prototype&&null!==Object.getPrototypeOf(t);export{n as isBoolean,i as isBuiltInConstructor,f as isClass,a as isInstanceOfUnknownClass,c as isNotBoolean,o as isNotNumber,r as isNotString,u as isNotUndefined,e as isNumber,y as isObjectLoose,l as isObjectStrict,t as isString,p as isUndefined};\n//# sourceMappingURL=typeof.js.map\n"],"names":["limit","x","low","high","min","max","clip_rgb","rgb","_clipped","_unclipped","slice","i","classToType","name","toLowerCase","type","obj","Object","prototype","toString","call","unpack","args","keyOrder","length","Array","split","filter","k","undefined","map","last","l","PI","Math","TWOPI","PITHIRD","DEG2RAD","RAD2DEG","input","format","autodetect","Color","constructor","me","this","mode","_input","sorted","sort","a","b","p","chk","test","Error","apply","_rgb","push","hex","join","chroma","version","cmyk","r","g","f","rgb2cmyk","c","m","y","alpha","rnd","round","rgb2hsl","minRgb","maxRgb","s","h","Number","NaN","rgb2css","rgba","substr","hsla","hsl2css","hsl2rgb","t3","t2","t1","h_","RE_RGB","RE_RGBA","RE_RGB_PCT","RE_RGBA_PCT","RE_HSL","RE_HSLA","css2rgb","css","trim","named","e","match","hsl","rest","gl","floor","hcg","delta","_g","rgb2hcg","_c","q","t","v","RE_HEX","RE_HEXA","hex2rgb","u","parseInt","rgb2hex","str","hxa","indexOf","cos","sqrt","acos","hsi","min_","rgb2hsi","isNaN","hsv","max_","rgb2hsv","LAB_CONSTANTS","pow","lab2rgb","z","b_","lab_xyz","xyz_rgb","rgb2lab","rgb2xyz","rgb_xyz","xyz_lab","lab","sin","lch2lab","lch2rgb","L","atan2","lab2lch","rgb2lch","lch","hcl","reverse","forEach","w3cx11","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","laserlemon","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrod","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","maroon2","maroon3","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","purple2","purple3","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","n","keys","num","rgb2num","log","temperature2rgb","kelvin","temp","temperature","minTemp","maxTemp","rgb2temperature","sign","oklab2rgb","lrgb2rgb","abs","cbrt","rgb2oklab","lr","lg","lb","rgb2lrgb","oklab","oklch","rgb2oklch","mutate","clipped","darken","amount","brighten","darker","brighter","get","mc","channel","src","luminance","lum","cur_lum","max_iter","mid","interpolate","lm","rgb2luminance","luminance_x","index","mix","col1","col2","interpolator","premultiply","saturate","desaturate","set","value","charAt","out","tint","shade","xyz0","xyz1","lrgb","x1","y1","z1","x2","y2","z2","interpolate_hsx","hue0","hue1","sat0","sat1","lbv0","lbv1","sat","hue","lbv","dh","c1","c2","_average_lrgb","colors","weights","xyz","col","scale","_mode","_nacol","_spread","_domain","_pos","_padding","_classes","_colors","_out","_min","_max","_correctLightness","_colorCache","_useCache","_gamma","setColors","brewer","resetCache","tMapLightness","tMapDomain","getColor","val","bypassMap","getClass","classes","d","analyze","limits","domain","arguments","from","tOut","tBreaks","every","_m","range","_o","spread","correctLightness","L0","L1","pol","L_actual","L_ideal","L_diff","t0","padding","numColors","result","dm","dd","left","right","ascending","end","__range__","samples","asc","cache","gamma","nodata","blend","bottom","top","blend_f","c0","each","normal","multiply","screen","overlay","lighten","dodge","burn","random","data","key","MAX_VALUE","sum","values","count","min_log","LOG10E","max_log","pb","pr","cluster","assignments","clusterSizes","repeat","nb_iters","centroids","j","best","mindist","dist","newCentroids","kClusters","tmpKMeansBreaks","exp","scales","cool","hot","colorbrewer","OrRd","PuBu","BuPu","Oranges","BuGn","YlOrBr","YlGn","Reds","RdPu","Greens","YlGnBu","Purples","GnBu","Greys","YlOrRd","PuRd","Blues","PuBuGn","Viridis","Spectral","RdYlGn","RdBu","PiYG","PRGn","RdYlBu","BrBG","RdGy","PuOr","Set2","Accent","Set1","Set3","Dark2","Paired","Pastel2","Pastel1","assign","average","reduce","w","first","shift","cnt","dx","dy","A","ci","xyz2","bezier","I","lab0","lab1","lab2","lab3","RangeError","labs","row","newrow","binom_row","el","cubehelix","start","rotations","lightness","dl","fract","amp","cos_a","sin_a","code","contrast","l1","l2","deltaE","Kl","Kc","Kh","rad2deg","rad","deg2rad","deg","a1","b1","L2","a2","b2","avgL","avgC","G","a1p","a2p","C1p","C2p","avgCp","arctan1","arctan2","h1p","h2p","avgHp","T","deltaHp","deltaL","deltaCp","sl","sc","sh","deltaTheta","Rt","distance","sum_sq","valid","context","nearestColor","needle","parseColor","distanceSq","minDistanceSq","Infinity","DEFAULT_COLORS","source","mapColors","color","createColorSpec","STANDARD_COLORS","hexMatch","substring","rgbMatch","parseComponentValue","leadingZero","rgbToHex","string","availableColors","nearestColorBase","matcher","or","alternateColors","extendedColors","concat","VERSION","module","exports","UnitHSL","toFixed","UnitHSLFloat","UnitXYZ","UnitCMYK","UnitRGBFloat","UnitHWB","UnitLAB","UnitOKLAB","UnitHSV","UnitLCH","UnitOKLCH","UnitHSI","toFloat","normalizeRGBInput","normalizeLABInput","MoebiusColor","hwb","rgbFloat","hslFloat","CONVERTERS.toHEX","CONVERTERS.toCMYK","CONVERTERS.toXYZ","CONVERTERS.toHSL","CONVERTERS.toHWB","CONVERTERS.toLAB","CONVERTERS.toOKLAB","CONVERTERS.toHSV","CONVERTERS.toLCH","CONVERTERS.toOKLCH","CONVERTERS.toHSI","CONVERTERS.toRGB","CONVERTERS.toFloat","toObject","CONVERTERS.toObject","MOEBIUS_PALETTE_DEFAULT_OPTIONS","diverging","randomOffset","noDuplicates","colorScaleMode","reverseDirection","harmonize","interval","options","h1","uniqueColors","Set","monochromatic","numberOfColors","hslColors","generateLuminanceShiftPalette","lRange","lStep","lStart","colorRange","stop","offset","diff","luminanceShiftAutoColors","divergentColor","ceil","getChromaBezierScaleColors","getChromaScaleColors","MoebiusAccentColors","luminanceShift","complement","triadic","tetradic","pentadic","hexadic","analogous","palette","toArray","flat","MoebiusPaletteColors","MoebiusThemeColors","darkMode","theme","MoebiusPalettes","baseColor","secondaryColor","themes","defaultOptions","all","accents","FEATURES.complement","primaryAccents","surfaceAccents","mixedAccents","primary","surface","mixed","FEATURES.darkMode","FEATURES.split","FEATURES.triadic","FEATURES.tetradic","FEATURES.pentadic","FEATURES.hexadic","FEATURES.analogous","primaryColor","FEATURES.interpolate","divergingColors","even","numberOfColorsLeft","numberOfColorsRight","generatedColors","generatedDivergentColors","stepsLeft","stepsRight","steps","FEATURES.luminanceShift","currentOptions","FEATURES.monochromatic","FEATURES.harmonize","MoebiusSVGHelper","xlmns","getColorPiePaths","size","df","document","createDocumentFragment","defsElement","createElementNS","maskElement","rectElement","gElement","id","setAttributeNS","appendChild","maskDegrees","initial","lineElement","group","inwardInterval","path","radius","centerX","centerY","pieSlice","async","Moebius","colorNames","response","fetch","json","entry","initializeColorNames","super","isString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAeA,EAAA,CAACC,EAAGC,EAAM,EAAGC,EAAO,IACxBC,EAAIC,EAAIH,EAAKD,GAAIE,GCDbG,EAACC,IACZA,EAAIC,UAAW,EACfD,EAAIE,WAAaF,EAAIG,MAAM,GAC3B,IAAK,IAAIC,EAAI,EAAGA,GAAK,EAAGA,IAChBA,EAAI,IACAJ,EAAII,GAAK,GAAKJ,EAAII,GAAK,OAAKJ,EAAIC,UAAW,GAC/CD,EAAII,GAAKX,EAAMO,EAAII,GAAI,EAAG,MACb,IAANA,IACPJ,EAAII,GAAKX,EAAMO,EAAII,GAAI,EAAG,IAGlC,OAAOJ,CAAG,ECZd,MAAMK,EAAc,CAAE,EACtB,IAAK,IAAIC,IAAQ,CACb,UACA,SACA,SACA,WACA,QACA,OACA,SACA,YACA,QAEAD,EAAY,WAAWC,MAAWA,EAAKC,cAE5B,SAAQC,EAAEC,GACrB,OAAOJ,EAAYK,OAAOC,UAAUC,SAASC,KAAKJ,KAAS,QAC/D,CCfA,IAAAK,EAAe,CAACC,EAAMC,EAAW,OAEzBD,EAAKE,QAAU,EAAUC,MAAMP,UAAUR,MAAMU,KAAKE,GAGnC,UAAjBP,EAAKO,EAAK,KAAmBC,EACtBA,EACFG,MAAM,IAC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AQuI,EAAM,CAChB,MAAM5X,EAAOqP,EAEbA,EAAQuI,EACRA,EAAO5X,EAWT,MAAO,KAPQ6c,EAAUD,EAASzuB,KAAK0F,KAAc,GAARwb,IAAelhB,KAAKD,GAAK,SACvD4uB,EAAUF,EAASzuB,KAAKgH,KAAc,GAARka,IAAelhB,KAAKD,GAAK,WAMpC0uB,KAAUA,OAHvBhF,EAAOvI,GAAS,IAAM,IAAM,SAFpCwN,EAAUD,EAASzuB,KAAK0F,KAAa,GAAP+jB,IAAczpB,KAAKD,GAAK,SACtD4uB,EAAUF,EAASzuB,KAAKgH,KAAa,GAAPyiB,IAAczpB,KAAKD,GAAK,WAIyB2uB,KAAWC,KAAW,EHqC7EC,CAAS1N,EAAO0H,EAAU9mB,IACzDisB,EAASG,YAAYM,EAAK,GAC1B,IAEJb,EAAYO,YAAYL,GACxBL,EAAGU,YAAYP,GACfH,EAAGU,YAAYH,GAERP,GIvCXqB,eAAeC,KACb,MAAMC,OAtBqBF,WAG3B,MAAMG,QAAiBC,MAAM,yCAEvBzY,SADawY,EAASE,QACR1Y,OACd5W,EAAM,CAAE,EAMd,OAJA4W,EAAO9O,SAASynB,IACdvvB,EAAIuvB,EAAMxwB,MAAkBwwB,EAAM1tB,GAAG,IAGhC4iB,GAAa1L,KAAK/Y,EAAI,EAUJwvB,GAazB,MAAO,CACLlI,aAZF,cAAmCA,GACjC,WAAAzmB,CAAYqkB,GACVuK,MACE1tB,EAAOmjB,GAAOrjB,MCtBdsD,IAAG,iBAAiBA,EDuBpBuqB,CAASP,EAAWjK,IACfiK,EAAWjK,GACXiK,EAAWjK,GAA2CnmB,QAO/DqsB,mBACAoC,oBAEJ","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,150]}