@pixerate/editor 0.106.0 → 0.108.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.
Files changed (70) hide show
  1. package/THIRD_PARTY_NOTICES.md +4 -0
  2. package/dist/animation-editor/index.cjs +39 -39
  3. package/dist/animation-editor/index.d.cts +1 -1
  4. package/dist/animation-editor/index.d.ts +1 -1
  5. package/dist/animation-editor/index.js +1 -1
  6. package/dist/{chunk-DS7KDKPX.js → chunk-3PHA3UKI.js} +2 -2
  7. package/dist/{chunk-ZID226ZG.cjs → chunk-FRD3FUXI.cjs} +172 -172
  8. package/dist/{chunk-ZID226ZG.cjs.map → chunk-FRD3FUXI.cjs.map} +1 -1
  9. package/dist/{chunk-67FRIOPZ.js → chunk-G4BIYE6R.js} +2 -2
  10. package/dist/{chunk-PV42JITT.cjs → chunk-HUFQD4CB.cjs} +44 -44
  11. package/dist/{chunk-PV42JITT.cjs.map → chunk-HUFQD4CB.cjs.map} +1 -1
  12. package/dist/{chunk-63EFQCT5.js → chunk-HUQ7EHVI.js} +1140 -371
  13. package/dist/chunk-HUQ7EHVI.js.map +1 -0
  14. package/dist/{chunk-4X5MIVCE.js → chunk-SOROZ2BF.js} +3 -3
  15. package/dist/{chunk-CRMAXIUV.cjs → chunk-SZ6KMZNM.cjs} +157 -8
  16. package/dist/chunk-SZ6KMZNM.cjs.map +1 -0
  17. package/dist/{chunk-WSTEXEKD.cjs → chunk-T3QZ6S47.cjs} +92 -92
  18. package/dist/{chunk-WSTEXEKD.cjs.map → chunk-T3QZ6S47.cjs.map} +1 -1
  19. package/dist/{chunk-KANRAHTL.cjs → chunk-UTEVPQTS.cjs} +1353 -584
  20. package/dist/chunk-UTEVPQTS.cjs.map +1 -0
  21. package/dist/{chunk-HEW6KDNI.js → chunk-WMBIJCHA.js} +155 -6
  22. package/dist/chunk-WMBIJCHA.js.map +1 -0
  23. package/dist/{compositor-Bc3PNP3C.d.cts → compositor-D92URMlm.d.cts} +1 -1
  24. package/dist/{compositor-BsYYllvR.d.ts → compositor-Kt_M4ruo.d.ts} +1 -1
  25. package/dist/{export-_m3Es4ru.d.cts → export-JGWQEPJn.d.cts} +3 -3
  26. package/dist/{export-iMrop3Jm.d.ts → export-a9bnF7Cl.d.ts} +3 -3
  27. package/dist/image-editor/index.cjs +627 -619
  28. package/dist/image-editor/index.cjs.map +1 -1
  29. package/dist/image-editor/index.d.cts +8 -8
  30. package/dist/image-editor/index.d.ts +8 -8
  31. package/dist/image-editor/index.js +12 -4
  32. package/dist/image-editor/index.js.map +1 -1
  33. package/dist/{mixer-C1M1Nua_.d.cts → mixer-5ziHU8OS.d.cts} +1 -1
  34. package/dist/{mixer-Cu5a9Bzd.d.ts → mixer-DNqiYXYQ.d.ts} +1 -1
  35. package/dist/paint/index.cjs +3 -3
  36. package/dist/paint/index.d.cts +2 -2
  37. package/dist/paint/index.d.ts +2 -2
  38. package/dist/paint/index.js +2 -2
  39. package/dist/paint-editor/index.cjs +365 -132
  40. package/dist/paint-editor/index.cjs.map +1 -1
  41. package/dist/paint-editor/index.d.cts +113 -8
  42. package/dist/paint-editor/index.d.ts +113 -8
  43. package/dist/paint-editor/index.js +249 -16
  44. package/dist/paint-editor/index.js.map +1 -1
  45. package/dist/raster/index.cjs +11 -3
  46. package/dist/raster/index.cjs.map +1 -1
  47. package/dist/raster/index.d.cts +4 -4
  48. package/dist/raster/index.d.ts +4 -4
  49. package/dist/raster/index.js +10 -2
  50. package/dist/{surface-BBJN9wxg.d.ts → surface-CkKOHGPm.d.cts} +20 -2
  51. package/dist/{surface-BBJN9wxg.d.cts → surface-CkKOHGPm.d.ts} +20 -2
  52. package/dist/{svg-Bj1MQFh6.d.cts → svg-ClVIG4T7.d.cts} +26 -2
  53. package/dist/{svg-vme0PLNo.d.ts → svg-SseJTIrA.d.ts} +26 -2
  54. package/dist/vector/index.cjs +977 -948
  55. package/dist/vector/index.cjs.map +1 -1
  56. package/dist/vector/index.d.cts +266 -7
  57. package/dist/vector/index.d.ts +266 -7
  58. package/dist/vector/index.js +427 -398
  59. package/dist/vector/index.js.map +1 -1
  60. package/package.json +1 -1
  61. package/skills/pixerate-image-editor/SKILL.md +50 -7
  62. package/skills/pixerate-paint-editor/SKILL.md +21 -1
  63. package/skills/pixerate-vector/SKILL.md +35 -5
  64. package/dist/chunk-63EFQCT5.js.map +0 -1
  65. package/dist/chunk-CRMAXIUV.cjs.map +0 -1
  66. package/dist/chunk-HEW6KDNI.js.map +0 -1
  67. package/dist/chunk-KANRAHTL.cjs.map +0 -1
  68. /package/dist/{chunk-DS7KDKPX.js.map → chunk-3PHA3UKI.js.map} +0 -0
  69. /package/dist/{chunk-67FRIOPZ.js.map → chunk-G4BIYE6R.js.map} +0 -0
  70. /package/dist/{chunk-4X5MIVCE.js.map → chunk-SOROZ2BF.js.map} +0 -0
@@ -26,7 +26,7 @@ import {
26
26
  tilesInRect,
27
27
  translateSurface,
28
28
  writeRegion
29
- } from "./chunk-HEW6KDNI.js";
29
+ } from "./chunk-WMBIJCHA.js";
30
30
 
31
31
  // src/raster/blur.ts
32
32
  function gaussianKernel(sigma) {
@@ -4652,4 +4652,4 @@ export {
4652
4652
  parseDataUrl,
4653
4653
  pngDataUrl
4654
4654
  };
4655
- //# sourceMappingURL=chunk-67FRIOPZ.js.map
4655
+ //# sourceMappingURL=chunk-G4BIYE6R.js.map
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkCRMAXIUVcjs = require('./chunk-CRMAXIUV.cjs');
11
+ var _chunkSZ6KMZNMcjs = require('./chunk-SZ6KMZNM.cjs');
12
12
 
13
13
  // src/paint/brush.ts
14
14
  var DEFAULT_BRUSH = {
@@ -221,41 +221,41 @@ function rasterizeDab(d, hardness, rect, out) {
221
221
  }
222
222
  }
223
223
  }
224
- var TILE_PIXELS = _chunkCRMAXIUVcjs.TILE * _chunkCRMAXIUVcjs.TILE;
224
+ var TILE_PIXELS = _chunkSZ6KMZNMcjs.TILE * _chunkSZ6KMZNMcjs.TILE;
225
225
  var CoverageMap = (_class2 = class {constructor() { _class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this); }
226
226
  __init4() {this.tiles = /* @__PURE__ */ new Map()}
227
227
  __init5() {this.bounds = null}
228
228
  __init6() {this.dirty = /* @__PURE__ */ new Set()}
229
229
  get(x, y) {
230
- const tx = Math.floor(x / _chunkCRMAXIUVcjs.TILE);
231
- const ty = Math.floor(y / _chunkCRMAXIUVcjs.TILE);
232
- const t = this.tiles.get(_chunkCRMAXIUVcjs.tileKey.call(void 0, tx, ty));
233
- return t ? t[(y - ty * _chunkCRMAXIUVcjs.TILE) * _chunkCRMAXIUVcjs.TILE + (x - tx * _chunkCRMAXIUVcjs.TILE)] : 0;
230
+ const tx = Math.floor(x / _chunkSZ6KMZNMcjs.TILE);
231
+ const ty = Math.floor(y / _chunkSZ6KMZNMcjs.TILE);
232
+ const t = this.tiles.get(_chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty));
233
+ return t ? t[(y - ty * _chunkSZ6KMZNMcjs.TILE) * _chunkSZ6KMZNMcjs.TILE + (x - tx * _chunkSZ6KMZNMcjs.TILE)] : 0;
234
234
  }
235
235
  /** Builds up `vals` (over `rect`) with flow towards `ceil`: `c ← c + v·(ceil − c)`. */
236
236
  accumulate(rect, vals, ceil) {
237
237
  if (rect.width <= 0 || rect.height <= 0) return;
238
238
  const w = rect.width;
239
- const tx0 = Math.floor(rect.x / _chunkCRMAXIUVcjs.TILE);
240
- const ty0 = Math.floor(rect.y / _chunkCRMAXIUVcjs.TILE);
241
- const tx1 = Math.floor((rect.x + rect.width - 1) / _chunkCRMAXIUVcjs.TILE);
242
- const ty1 = Math.floor((rect.y + rect.height - 1) / _chunkCRMAXIUVcjs.TILE);
239
+ const tx0 = Math.floor(rect.x / _chunkSZ6KMZNMcjs.TILE);
240
+ const ty0 = Math.floor(rect.y / _chunkSZ6KMZNMcjs.TILE);
241
+ const tx1 = Math.floor((rect.x + rect.width - 1) / _chunkSZ6KMZNMcjs.TILE);
242
+ const ty1 = Math.floor((rect.y + rect.height - 1) / _chunkSZ6KMZNMcjs.TILE);
243
243
  let touched = false;
244
244
  for (let ty = ty0; ty <= ty1; ty++) {
245
245
  for (let tx = tx0; tx <= tx1; tx++) {
246
- const x0 = Math.max(rect.x, tx * _chunkCRMAXIUVcjs.TILE);
247
- const y0 = Math.max(rect.y, ty * _chunkCRMAXIUVcjs.TILE);
248
- const x1 = Math.min(rect.x + rect.width, tx * _chunkCRMAXIUVcjs.TILE + _chunkCRMAXIUVcjs.TILE);
249
- const y1 = Math.min(rect.y + rect.height, ty * _chunkCRMAXIUVcjs.TILE + _chunkCRMAXIUVcjs.TILE);
246
+ const x0 = Math.max(rect.x, tx * _chunkSZ6KMZNMcjs.TILE);
247
+ const y0 = Math.max(rect.y, ty * _chunkSZ6KMZNMcjs.TILE);
248
+ const x1 = Math.min(rect.x + rect.width, tx * _chunkSZ6KMZNMcjs.TILE + _chunkSZ6KMZNMcjs.TILE);
249
+ const y1 = Math.min(rect.y + rect.height, ty * _chunkSZ6KMZNMcjs.TILE + _chunkSZ6KMZNMcjs.TILE);
250
250
  let tile;
251
251
  for (let y = y0; y < y1; y++) {
252
252
  const row = (y - rect.y) * w;
253
- const trow = (y - ty * _chunkCRMAXIUVcjs.TILE) * _chunkCRMAXIUVcjs.TILE;
253
+ const trow = (y - ty * _chunkSZ6KMZNMcjs.TILE) * _chunkSZ6KMZNMcjs.TILE;
254
254
  for (let x = x0; x < x1; x++) {
255
255
  const v = vals[row + (x - rect.x)];
256
256
  if (v <= 0) continue;
257
257
  if (!tile) {
258
- const key = _chunkCRMAXIUVcjs.tileKey.call(void 0, tx, ty);
258
+ const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty);
259
259
  tile = this.tiles.get(key);
260
260
  if (!tile) {
261
261
  tile = new Float32Array(TILE_PIXELS);
@@ -264,7 +264,7 @@ var CoverageMap = (_class2 = class {constructor() { _class2.prototype.__init4.ca
264
264
  this.dirty.add(key);
265
265
  touched = true;
266
266
  }
267
- const ti = trow + (x - tx * _chunkCRMAXIUVcjs.TILE);
267
+ const ti = trow + (x - tx * _chunkSZ6KMZNMcjs.TILE);
268
268
  const c = tile[ti];
269
269
  if (ceil > c) tile[ti] = c + v * (ceil - c);
270
270
  }
@@ -336,35 +336,35 @@ var StrokeCoverage = (_class3 = class {
336
336
  }, _class3);
337
337
  function applyStrokeToTile(coverage, tileData, channels, tx, ty, s, options = {}) {
338
338
  const out = options.into ? new Uint8ClampedArray(options.into) : new Uint8ClampedArray(tileData);
339
- const ox = tx * _chunkCRMAXIUVcjs.TILE + s.offset.x;
340
- const oy = ty * _chunkCRMAXIUVcjs.TILE + s.offset.y;
339
+ const ox = tx * _chunkSZ6KMZNMcjs.TILE + s.offset.x;
340
+ const oy = ty * _chunkSZ6KMZNMcjs.TILE + s.offset.y;
341
341
  let x0 = 0;
342
342
  let y0 = 0;
343
- let x1 = _chunkCRMAXIUVcjs.TILE;
344
- let y1 = _chunkCRMAXIUVcjs.TILE;
343
+ let x1 = _chunkSZ6KMZNMcjs.TILE;
344
+ let y1 = _chunkSZ6KMZNMcjs.TILE;
345
345
  if (options.region) {
346
346
  const r = options.region;
347
347
  x0 = Math.max(0, Math.floor(r.x) - ox);
348
348
  y0 = Math.max(0, Math.floor(r.y) - oy);
349
- x1 = Math.min(_chunkCRMAXIUVcjs.TILE, Math.ceil(r.x + r.width) - ox);
350
- y1 = Math.min(_chunkCRMAXIUVcjs.TILE, Math.ceil(r.y + r.height) - oy);
349
+ x1 = Math.min(_chunkSZ6KMZNMcjs.TILE, Math.ceil(r.x + r.width) - ox);
350
+ y1 = Math.min(_chunkSZ6KMZNMcjs.TILE, Math.ceil(r.y + r.height) - oy);
351
351
  if (x1 <= x0 || y1 <= y0) return out;
352
352
  if (options.into) {
353
- for (let y = y0; y < y1; y++) out.set(tileData.subarray((y * _chunkCRMAXIUVcjs.TILE + x0) * channels, (y * _chunkCRMAXIUVcjs.TILE + x1) * channels), (y * _chunkCRMAXIUVcjs.TILE + x0) * channels);
353
+ for (let y = y0; y < y1; y++) out.set(tileData.subarray((y * _chunkSZ6KMZNMcjs.TILE + x0) * channels, (y * _chunkSZ6KMZNMcjs.TILE + x1) * channels), (y * _chunkSZ6KMZNMcjs.TILE + x0) * channels);
354
354
  }
355
355
  }
356
356
  const sel = s.selection;
357
357
  const cb = [0, 0, 0, 0];
358
358
  const cs = [s.color[0] / 255, s.color[1] / 255, s.color[2] / 255, s.color[3] / 255];
359
359
  const bg = [s.background[0] / 255, s.background[1] / 255, s.background[2] / 255, s.background[3] / 255];
360
- const aligned = s.offset.x % _chunkCRMAXIUVcjs.TILE === 0 && s.offset.y % _chunkCRMAXIUVcjs.TILE === 0;
361
- const covTile = aligned ? coverage.tiles.get(_chunkCRMAXIUVcjs.tileKey.call(void 0, Math.floor(ox / _chunkCRMAXIUVcjs.TILE), Math.floor(oy / _chunkCRMAXIUVcjs.TILE))) : void 0;
360
+ const aligned = s.offset.x % _chunkSZ6KMZNMcjs.TILE === 0 && s.offset.y % _chunkSZ6KMZNMcjs.TILE === 0;
361
+ const covTile = aligned ? coverage.tiles.get(_chunkSZ6KMZNMcjs.tileKey.call(void 0, Math.floor(ox / _chunkSZ6KMZNMcjs.TILE), Math.floor(oy / _chunkSZ6KMZNMcjs.TILE))) : void 0;
362
362
  if (aligned && !covTile) return out;
363
363
  for (let y = y0; y < y1; y++) {
364
364
  const dy = oy + y;
365
365
  for (let x = x0; x < x1; x++) {
366
366
  const dx = ox + x;
367
- const c = covTile ? covTile[y * _chunkCRMAXIUVcjs.TILE + x] : coverage.get(dx, dy);
367
+ const c = covTile ? covTile[y * _chunkSZ6KMZNMcjs.TILE + x] : coverage.get(dx, dy);
368
368
  if (c <= 0) continue;
369
369
  let k = c * s.opacity;
370
370
  if (sel) {
@@ -373,7 +373,7 @@ function applyStrokeToTile(coverage, tileData, channels, tx, ty, s, options = {}
373
373
  }
374
374
  if (k > 1) k = 1;
375
375
  if (k <= 0) continue;
376
- const p = y * _chunkCRMAXIUVcjs.TILE + x;
376
+ const p = y * _chunkSZ6KMZNMcjs.TILE + x;
377
377
  if (channels === 1) {
378
378
  const target = s.mode === "erase" ? s.background[0] : s.color[0];
379
379
  out[p] = Math.round(out[p] + (target - out[p]) * k);
@@ -391,7 +391,7 @@ function applyStrokeToTile(coverage, tileData, channels, tx, ty, s, options = {}
391
391
  const as = src[3] * k;
392
392
  if (!(as > 0)) continue;
393
393
  const ao = as + out[i + 3] / 255 * (1 - as);
394
- _chunkCRMAXIUVcjs.mixPigment8.call(void 0, out[i], out[i + 1], out[i + 2], bytes[0], bytes[1], bytes[2], as / ao, cb);
394
+ _chunkSZ6KMZNMcjs.mixPigment8.call(void 0, out[i], out[i + 1], out[i + 2], bytes[0], bytes[1], bytes[2], as / ao, cb);
395
395
  out[i] = Math.round(cb[0] * 255);
396
396
  out[i + 1] = Math.round(cb[1] * 255);
397
397
  out[i + 2] = Math.round(cb[2] * 255);
@@ -399,7 +399,7 @@ function applyStrokeToTile(coverage, tileData, channels, tx, ty, s, options = {}
399
399
  continue;
400
400
  }
401
401
  for (let ch = 0; ch < 4; ch++) cb[ch] = out[i + ch] / 255;
402
- const o = _chunkCRMAXIUVcjs.blendPixel.call(void 0, s.blend, cb, src, k);
402
+ const o = _chunkSZ6KMZNMcjs.blendPixel.call(void 0, s.blend, cb, src, k);
403
403
  out[i] = Math.round(o[0] * 255);
404
404
  out[i + 1] = Math.round(o[1] * 255);
405
405
  out[i + 2] = Math.round(o[2] * 255);
@@ -409,7 +409,7 @@ function applyStrokeToTile(coverage, tileData, channels, tx, ty, s, options = {}
409
409
  return out;
410
410
  }
411
411
  function coverageTileCoord(key) {
412
- return _chunkCRMAXIUVcjs.tileCoord.call(void 0, key);
412
+ return _chunkSZ6KMZNMcjs.tileCoord.call(void 0, key);
413
413
  }
414
414
 
415
415
  // src/paint/mixer.ts
@@ -453,7 +453,7 @@ var MixerStroke = (_class4 = class {
453
453
  this.reservoir = load.reservoir ? [load.reservoir[0], load.reservoir[1], load.reservoir[2]] : null;
454
454
  this.amount = this.reservoir ? Math.min(1, Math.max(0, load.amount)) : 0;
455
455
  this.pickup = load.pickup ? [load.pickup[0], load.pickup[1], load.pickup[2]] : null;
456
- this.pig = this.settings.mixing === "pigment" ? { res: _chunkCRMAXIUVcjs.createPigment.call(void 0, _nullishCoalesce(this.reservoir, () => ( [0, 0, 0]))), pick: _chunkCRMAXIUVcjs.createPigment.call(void 0, _nullishCoalesce(this.pickup, () => ( [0, 0, 0]))), paint: _chunkCRMAXIUVcjs.createPigment.call(void 0, [0, 0, 0]), canvas: _chunkCRMAXIUVcjs.createPigment.call(void 0, [0, 0, 0]) } : null;
456
+ this.pig = this.settings.mixing === "pigment" ? { res: _chunkSZ6KMZNMcjs.createPigment.call(void 0, _nullishCoalesce(this.reservoir, () => ( [0, 0, 0]))), pick: _chunkSZ6KMZNMcjs.createPigment.call(void 0, _nullishCoalesce(this.pickup, () => ( [0, 0, 0]))), paint: _chunkSZ6KMZNMcjs.createPigment.call(void 0, [0, 0, 0]), canvas: _chunkSZ6KMZNMcjs.createPigment.call(void 0, [0, 0, 0]) } : null;
457
457
  }
458
458
 
459
459
 
@@ -493,7 +493,7 @@ var MixerStroke = (_class4 = class {
493
493
  /** `a` mixed `t` of the way to `b` into `this.out`, by the mixing model. */
494
494
  mix(a, pa, b, pb, t) {
495
495
  const o = this.out;
496
- if (pa && pb) _chunkCRMAXIUVcjs.lerpPigmentInto.call(void 0, pa, pb, t, o, 0);
496
+ if (pa && pb) _chunkSZ6KMZNMcjs.lerpPigmentInto.call(void 0, pa, pb, t, o, 0);
497
497
  else for (let c = 0; c < 3; c++) o[c] = a[c] + (b[c] - a[c]) * t;
498
498
  return o;
499
499
  }
@@ -522,15 +522,15 @@ var MixerStroke = (_class4 = class {
522
522
  const t = this.target;
523
523
  const lx = dx - t.offset.x;
524
524
  const ly = dy - t.offset.y;
525
- const tx = Math.floor(lx / _chunkCRMAXIUVcjs.TILE);
526
- const ty = Math.floor(ly / _chunkCRMAXIUVcjs.TILE);
525
+ const tx = Math.floor(lx / _chunkSZ6KMZNMcjs.TILE);
526
+ const ty = Math.floor(ly / _chunkSZ6KMZNMcjs.TILE);
527
527
  if (tx !== this.tx || ty !== this.ty || write && !this.writable) {
528
528
  this.tx = tx;
529
529
  this.ty = ty;
530
530
  this.tile = write ? t.writeTile(tx, ty) : t.readTile(tx, ty);
531
531
  this.writable = write;
532
532
  }
533
- return this.tile ? ((ly - ty * _chunkCRMAXIUVcjs.TILE) * _chunkCRMAXIUVcjs.TILE + (lx - tx * _chunkCRMAXIUVcjs.TILE)) * 4 : -1;
533
+ return this.tile ? ((ly - ty * _chunkSZ6KMZNMcjs.TILE) * _chunkSZ6KMZNMcjs.TILE + (lx - tx * _chunkSZ6KMZNMcjs.TILE)) * 4 : -1;
534
534
  }
535
535
  dab(d, rect, cov) {
536
536
  const { wet, mix, load } = this.settings;
@@ -563,11 +563,11 @@ var MixerStroke = (_class4 = class {
563
563
  const canvas = [ar / asum, ag / asum, ab / asum];
564
564
  if (!this.pickup) this.pickup = canvas;
565
565
  else {
566
- if (pig) _chunkCRMAXIUVcjs.setPigmentColor.call(void 0, pig.canvas, canvas[0], canvas[1], canvas[2]);
566
+ if (pig) _chunkSZ6KMZNMcjs.setPigmentColor.call(void 0, pig.canvas, canvas[0], canvas[1], canvas[2]);
567
567
  const o = this.mix(this.pickup, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _ => _.pick]), () => ( null)), canvas, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _2 => _2.canvas]), () => ( null)), MIXER_PICKUP_RATE * wet * (asum / Math.max(1e-6, wsum)));
568
568
  this.pickup = [o[0], o[1], o[2]];
569
569
  }
570
- if (pig) _chunkCRMAXIUVcjs.setPigmentColor.call(void 0, pig.pick, this.pickup[0], this.pickup[1], this.pickup[2]);
570
+ if (pig) _chunkSZ6KMZNMcjs.setPigmentColor.call(void 0, pig.pick, this.pickup[0], this.pickup[1], this.pickup[2]);
571
571
  }
572
572
  const res = this.reservoir;
573
573
  const wr = res ? this.amount * (1 - mix * wet) : 0;
@@ -575,7 +575,7 @@ var MixerStroke = (_class4 = class {
575
575
  const total = wr + wp;
576
576
  if (total > 1e-6) {
577
577
  const paint = res && this.pickup ? [...this.mix(res, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _3 => _3.res]), () => ( null)), this.pickup, _nullishCoalesce(_optionalChain([pig, 'optionalAccess', _4 => _4.pick]), () => ( null)), wp / total)] : [..._nullishCoalesce(res, () => ( this.pickup))];
578
- if (pig) _chunkCRMAXIUVcjs.setPigmentColor.call(void 0, pig.paint, paint[0], paint[1], paint[2]);
578
+ if (pig) _chunkSZ6KMZNMcjs.setPigmentColor.call(void 0, pig.paint, paint[0], paint[1], paint[2]);
579
579
  const dep = Math.min(1, total) * this.brush.flow * this.brush.opacity * d.opacity;
580
580
  if (dep > 0) this.deposit(rect, cov, paint, dep);
581
581
  }
@@ -617,10 +617,10 @@ var MixerStroke = (_class4 = class {
617
617
  } else if (pig) {
618
618
  const key = px[i] << 16 | px[i + 1] << 8 | px[i + 2];
619
619
  if (key !== lastKey) {
620
- _chunkCRMAXIUVcjs.setPigmentColor.call(void 0, pig.canvas, px[i] / 255, px[i + 1] / 255, px[i + 2] / 255);
620
+ _chunkSZ6KMZNMcjs.setPigmentColor.call(void 0, pig.canvas, px[i] / 255, px[i + 1] / 255, px[i + 2] / 255);
621
621
  lastKey = key;
622
622
  }
623
- _chunkCRMAXIUVcjs.lerpPigmentInto.call(void 0, pig.canvas, pig.paint, share, o, 0);
623
+ _chunkSZ6KMZNMcjs.lerpPigmentInto.call(void 0, pig.canvas, pig.paint, share, o, 0);
624
624
  } else {
625
625
  for (let c = 0; c < 3; c++) o[c] = px[i + c] / 255 + (paint[c] - px[i + c] / 255) * share;
626
626
  }
@@ -689,8 +689,8 @@ function createPigmentTools() {
689
689
  const rgbs = items.map((item, i) => parseHex(item.color, i));
690
690
  const total = items.reduce((sum, item) => sum + item.weight, 0);
691
691
  if (!(total > 0)) throw new Error("Every weight is 0; give at least one colour a weight above 0.");
692
- const pigments = rgbs.map((rgb, i) => _chunkCRMAXIUVcjs.createPigment.call(void 0, rgb, { strength: items[i].strength }));
693
- const mixed = _chunkCRMAXIUVcjs.mixPigments.call(void 0, pigments, items.map((item) => item.weight));
692
+ const pigments = rgbs.map((rgb, i) => _chunkSZ6KMZNMcjs.createPigment.call(void 0, rgb, { strength: items[i].strength }));
693
+ const mixed = _chunkSZ6KMZNMcjs.mixPigments.call(void 0, pigments, items.map((item) => item.weight));
694
694
  const lerp = [0, 1, 2].map((c) => rgbs.reduce((sum, rgb, i) => sum + rgb[c] * items[i].weight, 0) / total);
695
695
  return {
696
696
  mixed: toHex(mixed),
@@ -731,4 +731,4 @@ function createPigmentTools() {
731
731
 
732
732
 
733
733
  exports.DEFAULT_BRUSH = DEFAULT_BRUSH; exports.MAX_BRUSH_SIZE = MAX_BRUSH_SIZE; exports.normalizeBrush = normalizeBrush; exports.tipShape = tipShape; exports.tipFalloff = tipFalloff; exports.tipReach = tipReach; exports.dabCoverage = dabCoverage; exports.smoothPoints = smoothPoints; exports.DabWalker = DabWalker; exports.walkDabs = walkDabs; exports.dabRect = dabRect; exports.rasterizeDab = rasterizeDab; exports.CoverageMap = CoverageMap; exports.StrokeCoverage = StrokeCoverage; exports.applyStrokeToTile = applyStrokeToTile; exports.coverageTileCoord = coverageTileCoord; exports.MIXING_MODELS = MIXING_MODELS; exports.DEFAULT_MIXER = DEFAULT_MIXER; exports.MIXER_PICKUP_RATE = MIXER_PICKUP_RATE; exports.MIXER_DRAIN = MIXER_DRAIN; exports.normalizeMixer = normalizeMixer; exports.EMPTY_MIXER_LOAD = EMPTY_MIXER_LOAD; exports.loadMixer = loadMixer; exports.cleanMixer = cleanMixer; exports.MixerStroke = MixerStroke; exports.createPigmentTools = createPigmentTools;
734
- //# sourceMappingURL=chunk-PV42JITT.cjs.map
734
+ //# sourceMappingURL=chunk-HUFQD4CB.cjs.map