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mB,EAE/B,GAAIC,EAAQ,EAAG,CACb,MAAMC,EAAUtB,EAAQlJ,KAAKyK,KAAKF,GAC5BG,EAAWvB,EAASnJ,KAAKyK,KAAKF,GAC9BhB,EAAMQ,EAAWS,EAASE,GAEhC,OADAnB,EAAIY,UAAUH,EAAW,EAAG,EAAGQ,EAASE,GACjCnB,EAAIa,aAAa,EAAG,EAAGI,EAASE,EACzC,CAAO,CACL,MAAMnB,EAAMQ,EAAWb,EAAOC,GAE9B,OADAI,EAAIY,UAAUH,EAAW,EAAG,GACrBT,EAAIa,aAAa,EAAG,EAAGlB,EAAOC,EACvC,CACF,C,oBEpTAwB,IAAuB/M,IACnB,MAAM,IAAEsK,EAAG,EAAExE,GAAM9F,EAEnB,OADeqK,EAASC,EAAItK,KAAM8F,EACrB,G","sources":["webpack://sakurairo-scripts/./node_modules/.pnpm/promise-worker@2.0.1/node_modules/promise-worker/register.js","webpack://sakurairo-scripts/webpack/bootstrap","webpack://sakurairo-scripts/webpack/runtime/compat get default export","webpack://sakurairo-scripts/webpack/runtime/define property getters","webpack://sakurairo-scripts/webpack/runtime/hasOwnProperty shorthand","webpack://sakurairo-scripts/./node_modules/.pnpm/github.com+KotoriK+neuquant-js@d27fa2f1a7a966e8dcacd0d610ab3ab798f946ca_hfp7f4nnfdzbrzea7hubd7iapq/node_modules/neuquant-js/dist/index.js","webpack://sakurairo-scripts/./node_modules/.pnpm/color-space@2.0.1/node_modules/color-space/xyz.js","webpack://sakurairo-scripts/./node_modules/.pnpm/@kotorik+palette@2.1.0/node_modules/@kotorik/palette/dist/index.modern.js","webpack://sakurairo-scripts/./node_modules/.pnpm/color-space@2.0.1/node_modules/color-space/lab.js","webpack://sakurairo-scripts/./src/app/theme-color/worker.ts"],"sourcesContent":["'use strict'\n\nfunction isPromise (obj) {\n // via https://unpkg.com/is-promise@2.1.0/index.js\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'\n}\n\nfunction registerPromiseWorker (callback) {\n function postOutgoingMessage (e, messageId, error, result) {\n function postMessage (msg) {\n /* istanbul ignore if */\n if (typeof self.postMessage !== 'function') { // service worker\n e.ports[0].postMessage(msg)\n } else { // web worker\n self.postMessage(msg)\n }\n }\n if (error) {\n /* istanbul ignore else */\n if (typeof console !== 'undefined' && 'error' in console) {\n // This is to make errors easier to debug. I think it's important\n // enough to just leave here without giving the user an option\n // to silence it.\n console.error('Worker caught an error:', error)\n }\n postMessage([messageId, {\n message: error.message\n }])\n } else {\n postMessage([messageId, null, result])\n }\n }\n\n function tryCatchFunc (callback, message) {\n try {\n return { res: callback(message) }\n } catch (e) {\n return { err: e }\n }\n }\n\n function handleIncomingMessage (e, callback, messageId, message) {\n var result = tryCatchFunc(callback, message)\n\n if (result.err) {\n postOutgoingMessage(e, messageId, result.err)\n } else if (!isPromise(result.res)) {\n postOutgoingMessage(e, messageId, null, result.res)\n } else {\n result.res.then(function (finalResult) {\n postOutgoingMessage(e, messageId, null, finalResult)\n }, function (finalError) {\n postOutgoingMessage(e, messageId, finalError)\n })\n }\n }\n\n function onIncomingMessage (e) {\n var payload = e.data\n if (!Array.isArray(payload) || payload.length !== 2) {\n // message doens't match communication format; ignore\n return\n }\n var messageId = payload[0]\n var message = payload[1]\n\n if (typeof callback !== 'function') {\n postOutgoingMessage(e, messageId, new Error(\n 'Please pass a function into register().'))\n } else {\n handleIncomingMessage(e, callback, messageId, message)\n }\n }\n\n self.addEventListener('message', onIncomingMessage)\n}\n\nmodule.exports = registerPromiseWorker\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/**\n * NeuQuant Neural-Network Quantization Algorithm\n *\n * Copyright (c) 1994 Anthony Dekker\n *\n * See \"Kohonen neural networks for optimal colour quantization\" in \"Network:\n * Computation in Neural Systems\" Vol. 5 (1994) pp 351-367. for a discussion of\n * the algorithm.\n *\n * See also http://members.ozemail.com.au/~dekker/NEUQUANT.HTML\n *\n * Any party obtaining a copy of these files from the author, directly or\n * indirectly, is granted, free of charge, a full and unrestricted irrevocable,\n * world-wide, paid up, royalty-free, nonexclusive right and license to deal in\n * this software and documentation files (the \"Software\"), including without\n * limitation the rights to use, copy, modify, merge, publish, distribute,\n * sublicense, and/or sell copies of the Software, and to permit persons who\n * receive copies from any such party to do so, with the only requirement being\n * that this copyright notice remain intact.\n *\n * Copyright (c) 2012 Johan Nordberg (JavaScript port)\n * Copyright (c) 2014 Devon Govett (JavaScript port)\n */\n\nvar prime1 = 499;\nvar prime2 = 491;\nvar prime3 = 487;\nvar prime4 = 503;\nvar maxprime = Math.max(prime1, prime2, prime3, prime4);\nvar minpicturebytes = 3 * maxprime;\nvar defaults = {\n ncycles: 100,\n netsize: 256,\n samplefac: 10\n};\nvar assign = function assign(target) {\n for (var i = 1, l = arguments.length; i < l; i++) {\n var nextSource = arguments[i];\n if (nextSource != null) {\n for (var nextKey in nextSource) {\n if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {\n target[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n return target;\n};\nvar NeuQuant = /*#__PURE__*/function () {\n function NeuQuant(pixels, options) {\n assign(this, defaults, {\n pixels: pixels\n }, options);\n if (this.netsize < 4 || this.netsize > 256) {\n throw new Error('Color count must be between 4 and 256');\n }\n if (this.samplefac < 1 || this.samplefac > 30) {\n throw new Error('Sampling factor must be between 1 and 30');\n }\n this.maxnetpos = this.netsize - 1;\n this.netbiasshift = 4;\n this.intbiasshift = 16;\n this.intbias = 1 << this.intbiasshift;\n this.gammashift = 10;\n this.gamma = 1 << this.gammashift;\n this.betashift = 10;\n this.beta = this.intbias >> this.betashift;\n this.betagamma = this.beta * this.gamma;\n this.initrad = this.netsize >> 3;\n this.radiusbiasshift = 6;\n this.radiusbias = 1 << this.radiusbiasshift;\n this.initradius = this.initrad * this.radiusbias;\n this.radiusdec = 30;\n this.alphabiasshift = 10;\n this.initalpha = 1 << this.alphabiasshift;\n this.radbiasshift = 8;\n this.radbias = 1 << this.radbiasshift;\n this.alpharadbshift = this.alphabiasshift + this.radbiasshift;\n this.alpharadbias = 1 << this.alpharadbshift;\n this.network = [];\n this.netindex = new Uint32Array(256);\n this.bias = new Uint32Array(this.netsize);\n this.freq = new Uint32Array(this.netsize);\n this.radpower = new Uint32Array(this.netsize >> 3);\n for (var i = 0, l = this.netsize; i < l; i++) {\n var v = (i << this.netbiasshift + 8) / this.netsize;\n this.network[i] = new Float64Array([v, v, v, 0]);\n this.freq[i] = this.intbias / this.netsize;\n this.bias[i] = 0;\n }\n }\n var _proto = NeuQuant.prototype;\n _proto.unbiasnet = function unbiasnet() {\n for (var i = 0, l = this.netsize; i < l; i++) {\n this.network[i][0] >>= this.netbiasshift;\n this.network[i][1] >>= this.netbiasshift;\n this.network[i][2] >>= this.netbiasshift;\n this.network[i][3] = i;\n }\n };\n _proto.altersingle = function altersingle(alpha, i, b, g, r) {\n this.network[i][0] -= alpha * (this.network[i][0] - b) / this.initalpha;\n this.network[i][1] -= alpha * (this.network[i][1] - g) / this.initalpha;\n this.network[i][2] -= alpha * (this.network[i][2] - r) / this.initalpha;\n };\n _proto.alterneigh = function alterneigh(radius, i, b, g, r) {\n var lo = Math.abs(i - radius);\n var hi = Math.min(i + radius, this.netsize);\n var j = i + 1;\n var k = i - 1;\n var m = 1;\n while (j < hi || k > lo) {\n var a = this.radpower[m++];\n if (j < hi) {\n var p = this.network[j++];\n p[0] -= a * (p[0] - b) / this.alpharadbias;\n p[1] -= a * (p[1] - g) / this.alpharadbias;\n p[2] -= a * (p[2] - r) / this.alpharadbias;\n }\n if (k > lo) {\n var _p = this.network[k--];\n _p[0] -= a * (_p[0] - b) / this.alpharadbias;\n _p[1] -= a * (_p[1] - g) / this.alpharadbias;\n _p[2] -= a * (_p[2] - r) / this.alpharadbias;\n }\n }\n };\n _proto.contest = function contest(b, g, r) {\n var bestd = ~(1 << 31);\n var bestbiasd = bestd;\n var bestpos = -1;\n var bestbiaspos = bestpos;\n for (var i = 0, l = this.netsize; i < l; i++) {\n var n = this.network[i];\n var dist = Math.abs(n[0] - b) + Math.abs(n[1] - g) + Math.abs(n[2] - r);\n if (dist < bestd) {\n bestd = dist;\n bestpos = i;\n }\n var biasdist = dist - (this.bias[i] >> this.intbiasshift - this.netbiasshift);\n if (biasdist < bestbiasd) {\n bestbiasd = biasdist;\n bestbiaspos = i;\n }\n var betafreq = this.freq[i] >> this.betashift;\n this.freq[i] -= betafreq;\n this.bias[i] += betafreq << this.gammashift;\n }\n this.freq[bestpos] += this.beta;\n this.bias[bestpos] -= this.betagamma;\n return bestbiaspos;\n };\n _proto.inxbuild = function inxbuild() {\n var previouscol = 0;\n var startpos = 0;\n for (var i = 0, l = this.netsize; i < l; i++) {\n var p = this.network[i];\n var q = null;\n var smallpos = i;\n var smallval = p[1];\n for (var j = i + 1; j < l; j++) {\n q = this.network[j];\n if (q[1] < smallval) {\n smallpos = j;\n smallval = q[1];\n }\n }\n q = this.network[smallpos];\n if (i !== smallpos) {\n var _ref = [q[0], p[0]];\n p[0] = _ref[0];\n q[0] = _ref[1];\n var _ref2 = [q[1], p[1]];\n p[1] = _ref2[0];\n q[1] = _ref2[1];\n var _ref3 = [q[2], p[2]];\n p[2] = _ref3[0];\n q[2] = _ref3[1];\n var _ref4 = [q[3], p[3]];\n p[3] = _ref4[0];\n q[3] = _ref4[1];\n }\n if (smallval !== previouscol) {\n this.netindex[previouscol] = startpos + i >> 1;\n for (var _j = previouscol + 1; _j < smallval; _j++) {\n this.netindex[_j] = i;\n }\n previouscol = smallval;\n startpos = i;\n }\n }\n this.netindex[previouscol] = startpos + this.maxnetpos >> 1;\n for (var _i = previouscol + 1; _i < 256; _i++) {\n this.netindex[_i] = this.maxnetpos;\n }\n };\n _proto.learn = function learn() {\n var lengthcount = this.pixels.length;\n var alphadec = 30 + (this.samplefac - 1) / 3;\n var samplepixels = lengthcount / (3 * this.samplefac);\n var delta = samplepixels / this.ncycles | 0;\n var alpha = this.initalpha;\n var radius = this.initradius;\n var rad = radius >> this.radiusbiasshift;\n if (rad <= 1) {\n rad = 0;\n }\n for (var i = 0; i < rad; i++) {\n this.radpower[i] = alpha * ((rad * rad - i * i) * this.radbias / (rad * rad));\n }\n var step;\n if (lengthcount < minpicturebytes) {\n this.samplefac = 1;\n step = 3;\n } else if (lengthcount % prime1 !== 0) {\n step = 3 * prime1;\n } else if (lengthcount % prime2 !== 0) {\n step = 3 * prime2;\n } else if (lengthcount % prime3 !== 0) {\n step = 3 * prime3;\n } else {\n step = 3 * prime4;\n }\n var pix = 0;\n for (var _i2 = 0; _i2 < samplepixels;) {\n var b = (this.pixels[pix] & 0xff) << this.netbiasshift;\n var g = (this.pixels[pix + 1] & 0xff) << this.netbiasshift;\n var r = (this.pixels[pix + 2] & 0xff) << this.netbiasshift;\n var j = this.contest(b, g, r);\n this.altersingle(alpha, j, b, g, r);\n if (rad !== 0) {\n this.alterneigh(rad, j, b, g, r);\n }\n pix += step;\n if (pix >= lengthcount) {\n pix -= lengthcount;\n }\n if (delta === 0) {\n delta = 1;\n }\n if (++_i2 % delta === 0) {\n alpha -= alpha / alphadec;\n radius -= radius / this.radiusdec;\n rad = radius >> this.radiusbiasshift;\n if (rad <= 1) {\n rad = 0;\n }\n for (var k = 0; k < rad; k++) {\n this.radpower[k] = alpha * ((rad * rad - k * k) * this.radbias / (rad * rad));\n }\n }\n }\n };\n _proto.buildColorMap = function buildColorMap() {\n this.learn();\n this.unbiasnet();\n this.inxbuild();\n };\n _proto.getColorMap = function getColorMap() {\n var map = new Buffer(this.netsize * 3);\n var index = new Buffer(this.netsize);\n for (var i = 0, l = this.netsize; i < l; i++) {\n index[this.network[i][3]] = i;\n }\n for (var _i3 = 0, j = 0, k = 0, _l = this.netsize; _i3 < _l; _i3++) {\n k = index[_i3];\n map[j++] = this.network[k][0] & 0xff;\n map[j++] = this.network[k][1] & 0xff;\n map[j++] = this.network[k][2] & 0xff;\n }\n return map;\n };\n return NeuQuant;\n}();\n\nfunction findClosest(palette, r, g, b) {\n var minpos = 0;\n var mind = 256 * 256 * 256;\n for (var i = 0, l = palette.length; i < l;) {\n var dr = r - palette[i++];\n var dg = g - palette[i++];\n var db = b - palette[i];\n var d = dr * dr + dg * dg + db * db;\n var pos = i / 3 | 0;\n if (d < mind) {\n mind = d;\n minpos = pos;\n }\n i++;\n }\n return minpos;\n}\nfunction palette(pixels, options) {\n var nq = new NeuQuant(pixels, options);\n nq.buildColorMap();\n return nq.getColorMap();\n}\nfunction indexed(pixels, palette) {\n var indexed = []; /* new Buffer(pixels.length / 3) */\n var memo = {};\n for (var i = 0, j = 0, l = pixels.length; i < l;) {\n var r = pixels[i++];\n var g = pixels[i++];\n var b = pixels[i++];\n var k = r << 16 | g << 8 | b;\n if (k in memo) {\n indexed[j++] = memo[k];\n } else {\n indexed[j++] = memo[k] = findClosest(palette, r, g, b);\n }\n }\n return indexed;\n}\nfunction quantize(pixels, options) {\n var p = palette(pixels, options);\n var i = indexed(pixels, p);\n return {\n palette: p,\n indexed: i\n };\n}\n\nexport { indexed, palette, quantize };\n//# sourceMappingURL=index.js.map\n","/**\n * CIE XYZ\n *\n * @module color-space/xyz\n */\nimport rgb from './rgb.js';\n\nvar xyz = {\n\tname: 'xyz',\n\tmin: [0,0,0],\n\tchannel: ['X','Y','Z'],\n\talias: ['XYZ', 'ciexyz', 'cie1931']\n};\n\n\n/**\n * Whitepoint reference values with observer/illuminant\n *\n * http://en.wikipedia.org/wiki/Standard_illuminant\n */\nxyz.whitepoint = {\n\t//1931 2°\n\t2: {\n\t\t//incadescent\n\t\tA:[109.85, 100, 35.585],\n\t\t// B:[],\n\t\tC: [98.074, 100, 118.232],\n\t\tD50: [96.422, 100, 82.521],\n\t\tD55: [95.682, 100, 92.149],\n\t\t//daylight\n\t\tD65: [95.045592705167, 100, 108.9057750759878],\n\t\tD75: [94.972, 100, 122.638],\n\t\t//flourescent\n\t\t// F1: [],\n\t\tF2: [99.187, 100, 67.395],\n\t\t// F3: [],\n\t\t// F4: [],\n\t\t// F5: [],\n\t\t// F6:[],\n\t\tF7: [95.044, 100, 108.755],\n\t\t// F8: [],\n\t\t// F9: [],\n\t\t// F10: [],\n\t\tF11: [100.966, 100, 64.370],\n\t\t// F12: [],\n\t\tE: [100,100,100]\n\t},\n\n\t//1964 10°\n\t10: {\n\t\t//incadescent\n\t\tA:[111.144, 100, 35.200],\n\t\tC: [97.285, 100, 116.145],\n\t\tD50: [96.720, 100, 81.427],\n\t\tD55: [95.799, 100, 90.926],\n\t\t//daylight\n\t\tD65: [94.811, 100, 107.304],\n\t\tD75: [94.416, 100, 120.641],\n\t\t//flourescent\n\t\tF2: [103.280, 100, 69.026],\n\t\tF7: [95.792, 100, 107.687],\n\t\tF11: [103.866, 100, 65.627],\n\t\tE: [100,100,100]\n\t}\n};\n\n\n/**\n * Top values are the whitepoint’s top values, default are D65\n */\nxyz.max = xyz.whitepoint[2].D65;\n\n\n/**\n * Transform xyz to rgb\n *\n * @param {Array} xyz Array of xyz values\n *\n * @return {Array} RGB values\n */\nxyz.rgb = function (_xyz, white) {\n\t//FIXME: make sure we have to divide like this. Probably we have to replace matrix as well then\n\twhite = white || xyz.whitepoint[2].E;\n\n\tvar x = _xyz[0] / white[0],\n\t\ty = _xyz[1] / white[1],\n\t\tz = _xyz[2] / white[2],\n\t\tr, g, b;\n\n\t// assume sRGB\n\t// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n\tr = (x * 3.240969941904521) + (y * -1.537383177570093) + (z * -0.498610760293);\n\tg = (x * -0.96924363628087) + (y * 1.87596750150772) + (z * 0.041555057407175);\n\tb = (x * 0.055630079696993) + (y * -0.20397695888897) + (z * 1.056971514242878);\n\n\tr = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n\t\t: r = (r * 12.92);\n\n\tg = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n\t\t: g = (g * 12.92);\n\n\tb = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n\t\t: b = (b * 12.92);\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n}\n\n\n\n/**\n * RGB to XYZ\n *\n * @param {Array} rgb RGB channels\n *\n * @return {Array} XYZ channels\n */\nrgb.xyz = function(rgb, white) {\n\tvar r = rgb[0] / 255,\n\t\t\tg = rgb[1] / 255,\n\t\t\tb = rgb[2] / 255;\n\n\t// assume sRGB\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tvar x = (r * 0.41239079926595) + (g * 0.35758433938387) + (b * 0.18048078840183);\n\tvar y = (r * 0.21263900587151) + (g * 0.71516867876775) + (b * 0.072192315360733);\n\tvar z = (r * 0.019330818715591) + (g * 0.11919477979462) + (b * 0.95053215224966);\n\n\twhite = white || xyz.whitepoint[2].E;\n\n\treturn [x * white[0], y * white[1], z * white[2]];\n};\n\n\n\nexport default xyz;\n","import { palette, indexed } from 'neuquant-js';\nimport rgb from 'color-space/rgb.js';\nimport xyz from 'color-space/xyz.js';\nimport lab from 'color-space/lab.js';\n\n/**\r\n * 返回两个四维坐标间的欧几里得距离\r\n * @param a\r\n * @param b\r\n * @returns\r\n */\nfunction euclidean_distance_squared(a, b) {\n const r = a[0] - b[0];\n const g = a[1] - b[1];\n\n const _b = a[2] - b[2];\n\n const _a = a[3] - b[3];\n\n return r ** 2 + g ** 2 + _b ** 2 + _a ** 2;\n}\nfunction euclidean_distance_squared_index(a, a_start, b) {\n const r = a[a_start++] - b[0];\n const g = a[a_start++] - b[1];\n\n const _b = a[a_start++] - b[2];\n\n const _a = a[a_start++] - b[3];\n\n return r ** 2 + g ** 2 + _b ** 2 + _a ** 2;\n}\n/**\r\n * 以数组形式返回三个数字中的最大值与最小值\r\n * @param param0 一个包含三个数字的数组\r\n * @returns [max,min]\r\n */\n\nfunction max_min_of_three([a, b, c]) {\n if (a > b) {\n if (b > c) {\n //abc\n return [a, c];\n } else {\n if (a > c) {\n //acb\n return [a, b];\n } else {\n //cab\n return [c, b];\n }\n }\n } else {\n //a<b\n if (b > c) {\n if (c > a) {\n //bca\n return [b, a];\n } else {\n //bac\n return [b, c];\n }\n } else {\n //cba\n return [c, a];\n }\n }\n}\n\nfunction kmeans(data, k, attempt, thresold = 1) {\n const cluster_sum\n /*[r,g,b,a,c]*/\n = [];\n let cluster_centers = [];\n let new_cluster_centers = [];\n let iteration = 0;\n\n for (let i = 0; i < k; i++) {\n const start = Math.floor(Math.random() * data.length);\n cluster_centers.push(Array.from(data.slice(start, start + 4))); //随机选点\n\n new_cluster_centers.push(_filled_array(0, 4));\n cluster_sum.push(_filled_array(0, 5));\n }\n\n while (iteration < attempt) {\n //准备坐标和\n //计算每个点与中心的距离\n for (let i = 0; i < data.length;) {\n let cluster_index = 0;\n\n let _min_distance = euclidean_distance_squared_index(data, i, cluster_centers[0]);\n\n for (let j = 1; j < k; j++) {\n const distance = euclidean_distance_squared_index(data, i, cluster_centers[j]);\n\n if (distance < _min_distance) {\n _min_distance = distance;\n cluster_index = j;\n }\n }\n\n const sum = cluster_sum[cluster_index];\n sum[0] += data[i++];\n sum[1] += data[i++];\n sum[2] += data[i++];\n sum[3] += data[i++];\n sum[4]++;\n }\n\n let diff = 0; //重新计算中心点\n\n for (let i = 0; i < k; i++) {\n const rgbac = cluster_sum[i];\n const count = rgbac[4];\n\n if (count == 0) {\n //空类 重新选中心点\n const start = Math.floor(Math.random() * data.length);\n new_cluster_centers[i] = Array.from(data.slice(start, start + 4));\n diff += thresold;\n } else {\n const new_center = new_cluster_centers[i];\n\n for (let j = 0; j < 4; j++) {\n new_center[j] = rgbac[j] / count;\n }\n\n diff += Math.sqrt(euclidean_distance_squared(cluster_centers[i], new_cluster_centers[i]));\n }\n }\n\n if (diff <= thresold) {\n return {\n centroid: new_cluster_centers,\n iteration,\n fit: true,\n label: cluster_sum.map(v => v[4]),\n size: data.length\n };\n }\n\n const medium = cluster_centers;\n cluster_centers = new_cluster_centers;\n new_cluster_centers = medium;\n iteration++; //清空累加\n\n for (let i = 0; i < k; i++) {\n const sum_array = cluster_sum[i];\n sum_array[0] = 0;\n sum_array[1] = 0;\n sum_array[2] = 0;\n sum_array[3] = 0;\n sum_array[4] = 0;\n }\n }\n\n return {\n centroid: cluster_centers,\n iteration,\n fit: false,\n label: cluster_sum.map(v => v[4]),\n size: data.length\n };\n}\n\nfunction _filled_array(fillWith, count) {\n const array = [];\n\n for (let i = 0; i < count; i++) {\n array.push(fillWith);\n }\n\n return array;\n}\n\nfunction rgba2Rgb(data) {\n const rgb = new Uint8ClampedArray(data.length / 4 * 3);\n const len = data.length;\n let rgb_i = 0;\n\n for (let i = 0; i < len;) {\n for (let j = 0; j < 3; j++) {\n rgb[rgb_i++] = data[i++];\n }\n\n i++;\n }\n\n return rgb;\n}\n/**\r\n * @param samplefac Sampling factor, which can be changed to increase or decrease quality at the expense of performance. The lower the number, the higher the quality.\r\n * based on 'neuquant-js'\r\n */\n\n\nfunction neuquant(img, k, samplefac = 1) {\n const img_rgb = rgba2Rgb(img);\n const palette$1 = palette(img_rgb, {\n netsize: k,\n samplefac\n });\n const indexed_pixel = indexed(img_rgb, palette$1);\n const pixel = [];\n const len = palette$1.length;\n\n for (let i = 0; i < len;) {\n pixel.push([palette$1[i++], palette$1[i++], palette$1[i++], 255]);\n }\n\n return {\n centroid: pixel,\n label: count(k, indexed_pixel)\n };\n}\n\nfunction count(k, index) {\n const counts = new Array(k).fill(0);\n\n for (const i of index) {\n counts[i]++;\n }\n\n return counts;\n}\n\nfunction _prepare2DContext(width, height) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d'); //contextType 是存在的\n\n canvas.height = height;\n canvas.width = width;\n return ctx;\n}\n/**\r\n * Use OffscreenCanvas\r\n */\n\n\nfunction _prepare2DContextAsync(width, height) {\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext('2d');\n return ctx;\n}\n/**\r\n * a Promise resolved when <img> is loaded\r\n * @param imgElement\r\n * @returns Event, undefined when Image is already loaded\r\n */\n\n\nfunction awaitImage(imgElement) {\n return new Promise((resolve, reject) => {\n if (imgElement.complete) {\n resolve();\n } else {\n imgElement.addEventListener('load', e => {\n resolve(e);\n });\n imgElement.addEventListener('error', reason => {\n reject(reason);\n });\n }\n });\n}\nconst readImage = _readImage.bind(undefined, _prepare2DContext);\n/**\r\n * read image using OffscreenCanvas\r\n */\n\nconst readImageOffscreen = _readImage.bind(undefined, _prepare2DContextAsync);\n\nfunction _readImage(prepareCtx, imgSource) {\n const {\n naturalWidth,\n naturalHeight\n } = imgSource;\n const ctx = prepareCtx(naturalWidth, naturalHeight);\n ctx.drawImage(imgSource, 0, 0, naturalWidth, naturalHeight);\n return ctx.getImageData(0, 0, naturalWidth, naturalHeight);\n}\n/**\r\n * 降采样后读取图片\r\n * @param imgSource\r\n * @param maxSample\r\n * @returns\r\n */\n\n\nconst readImageDownsampling = _readImageDownsampling.bind(undefined, _prepare2DContext);\nconst readImageDownsamplingOffscreen = _readImageDownsampling.bind(undefined, _prepare2DContextAsync);\n\nfunction _readImageDownsampling(prepareCtx, imgSource, maxSample) {\n const {\n naturalWidth: width,\n naturalHeight: height\n } = imgSource;\n const scale = width * height / maxSample;\n\n if (scale > 1) {\n const n_width = width / Math.sqrt(scale);\n const n_height = height / Math.sqrt(scale);\n const ctx = prepareCtx(n_width, n_height);\n ctx.drawImage(imgSource, 0, 0, n_width, n_height);\n return ctx.getImageData(0, 0, n_width, n_height);\n } else {\n const ctx = prepareCtx(width, height);\n ctx.drawImage(imgSource, 0, 0);\n return ctx.getImageData(0, 0, width, height);\n }\n}\n\nfunction normalizeRGBA(rgba) {\n return rgba.map(v => v / 255);\n}\nfunction rgbaToHSLA(rgba) {\n let h, s; //@ts-ignore\n\n const [max, min] = max_min_of_three(rgba);\n const diff = max - min;\n const light_2x = max + min; //h\n\n if (diff == 0) {\n h = 0;\n s = 0;\n } else {\n if (max == rgba[0]) {\n const temp_h = 60 * (rgba[1] - rgba[2]) / diff;\n\n if (temp_h < 0) {\n h = temp_h + 360;\n } else {\n h = temp_h;\n }\n } else if (max == rgba[1]) {\n h = 60 * (rgba[2] - rgba[0]) / diff + 120;\n } else {\n h = 60 * (rgba[0] - rgba[1]) / diff + 240;\n }\n\n if (light_2x == 0) {\n s = 0;\n } else if (light_2x <= 1) {\n s = diff / light_2x;\n } else {\n s = diff / (2 - light_2x);\n }\n }\n\n return [h, s, light_2x / 2, rgba[3]];\n}\n/**\r\n * 返回一个排序HSLA颜色的函数\r\n * @param sort\r\n * @returns\r\n */\n\n\nconst getHSLAComparer = (sort = [0, 1, 2, 3]) => (a, b) => {\n let result;\n\n for (const s of sort) {\n result = a[s] - b[s];\n\n if (result != 0) {\n return result;\n }\n } //其实是赋了值的,但是ts没猜出来\n //@ts-ignore\n\n\n return result;\n};\n/**\r\n * 将颜色转换成对应的CSS文本\r\n * @param param0 像素\r\n * @returns hsla(${h}deg,${s}%,${l}%,${a})\r\n */\n\nconst hslaCSSText = ([h, s, l, a]) => `hsla(${h}deg,${s * 100}%,${l * 100}%,${a})`;\n/**\r\n * 将颜色转换成对应的CSS文本\r\n * @param pixel 像素\r\n * @returns rgba(r,g,b,a)\r\n */\n\nconst rgbaCSSText = pixel => `rgba(${pixel.map(v => Math.floor(v)).join(',')})`;\n\nfunction convertToLab(source) {\n //CIE Lab包含浮点表示,不能使用Uint8ClampedArray\n const array = [];\n\n for (let i = 0; i < source.length; i += 4) {\n const pixel = source.slice(i, i + 4);\n const alpha = pixel[3];\n const pixel_rgb = pixel.slice(0, 3);\n const pixel_xyz = rgb.xyz(pixel_rgb);\n const pixel_lab = xyz.lab(pixel_xyz);\n array.push(...pixel_lab, alpha);\n }\n\n return array;\n}\nfunction labaToRGBA(laba) {\n const pixel_lab = laba.slice(0, 3);\n const alpha = laba[3];\n const pixel_xyz = lab.xyz(pixel_lab);\n const pixel_rgb = xyz.rgb(pixel_xyz);\n pixel_rgb.push(alpha);\n return pixel_rgb;\n}\n\nexport { awaitImage, convertToLab, getHSLAComparer, hslaCSSText, kmeans, labaToRGBA, neuquant, normalizeRGBA, readImage, readImageDownsampling, readImageDownsamplingOffscreen, readImageOffscreen, rgbaCSSText, rgbaToHSLA };\n//# sourceMappingURL=index.modern.js.map\n","/**\n * CIE LAB space model\n *\n * @module color-space/lab\n */\n\nimport xyz from './xyz.js';\n\nexport default {\n\tname: 'lab',\n\tmin: [0,-100,-100],\n\tmax: [100,100,100],\n\tchannel: ['lightness', 'a', 'b'],\n\talias: ['LAB', 'cielab'],\n\n\txyz: function(lab) {\n\t\tvar l = lab[0],\n\t\t\t\ta = lab[1],\n\t\t\t\tb = lab[2],\n\t\t\t\tx, y, z, y2;\n\n\t\tif (l <= 8) {\n\t\t\ty = (l * 100) / 903.3;\n\t\t\ty2 = (7.787 * (y / 100)) + (16 / 116);\n\t\t} else {\n\t\t\ty = 100 * Math.pow((l + 16) / 116, 3);\n\t\t\ty2 = Math.pow(y / 100, 1/3);\n\t\t}\n\n\t\tx = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);\n\n\t\tz = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);\n\n\t\treturn [x, y, z];\n\t}\n};\n\n\n//extend xyz\nxyz.lab = function(xyz){\n\tvar x = xyz[0],\n\t\t\ty = xyz[1],\n\t\t\tz = xyz[2],\n\t\t\tl, a, b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n","import { neuquant } from \"@kotorik/palette\";\nimport registerPromiseWorker from 'promise-worker/register';\nregisterPromiseWorker((data) => {\n const { img, k } = data;\n const result = neuquant(img.data, k);\n return result;\n});\n"],"names":["module","exports","callback","postOutgoingMessage","e","messageId","error","result","postMessage","msg","self","ports","console","message","addEventListener","payload","data","Array","isArray","length","Error","obj","res","err","tryCatchFunc","then","finalResult","finalError","handleIncomingMessage","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","prop","prototype","hasOwnProperty","call","minpicturebytes","Math","max","defaults","ncycles","netsize","samplefac","NeuQuant","pixels","options","target","i","l","arguments","nextSource","nextKey","this","maxnetpos","netbiasshift","intbiasshift","intbias","gammashift","gamma","betashift","beta","betagamma","initrad","radiusbiasshift","radiusbias","initradius","radiusdec","alphabiasshift","initalpha","radbiasshift","radbias","alpharadbshift","alpharadbias","network","netindex","Uint32Array","bias","freq","radpower","v","Float64Array","_proto","unbiasnet","altersingle","alpha","b","g","r","alterneigh","radius","lo","abs","hi","min","j","k","m","p","_p","contest","bestd","bestbiasd","bestpos","bestbiaspos","dist","biasdist","betafreq","inxbuild","previouscol","startpos","q","smallpos","smallval","_ref","_ref2","_ref3","_ref4","_j","_i","learn","step","lengthcount","alphadec","samplepixels","delta","rad","pix","_i2","buildColorMap","getColorMap","map","Buffer","index","_i3","_l","findClosest","palette","minpos","mind","dr","dg","db","nq","indexed","memo","name","channel","alias","A","C","D50","D55","D65","D75","F2","F7","F11","E","whitepoint","rgb","_xyz","white","x","y","z","pow","neuquant","img","img_rgb","Uint8ClampedArray","len","rgb_i","rgba2Rgb","palette$1","indexed_pixel","pixel","push","centroid","label","count","counts","fill","_prepare2DContext","width","height","canvas","document","createElement","ctx","getContext","_prepare2DContextAsync","OffscreenCanvas","lab","xyz","_readImage","bind","prepareCtx","imgSource","naturalWidth","naturalHeight","drawImage","getImageData","_readImageDownsampling","maxSample","scale","n_width","sqrt","n_height","registerPromiseWorker"],"sourceRoot":""}