From 5680be169923b3c0bc27401bd8dfcd6b47ab8797 Mon Sep 17 00:00:00 2001 From: Andrew Michael McNutt Date: Thu, 18 Jan 2024 18:25:30 -0800 Subject: [PATCH] interpolant fix --- .../contextual-tools/InterpolatePoints.svelte | 23 +++++-------- src/lib/charts.ts | 32 ++----------------- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/src/content-modules/contextual-tools/InterpolatePoints.svelte b/src/content-modules/contextual-tools/InterpolatePoints.svelte index 12ffb1cf..f189f29d 100644 --- a/src/content-modules/contextual-tools/InterpolatePoints.svelte +++ b/src/content-modules/contextual-tools/InterpolatePoints.svelte @@ -9,6 +9,7 @@ import PalPreview from "../../components/PalPreview.svelte"; $: focusedColors = $focusStore.focusedColors; + $: focusSet = new Set(focusedColors); $: colors = $colorStore.currentPal.colors; let colorSpace = "lab"; let numPoints = 1; @@ -41,21 +42,15 @@ } return points; } - function createInterpolation(forPreview: boolean): Color[] { + function createInterpolation(): Color[] { const newColors = []; for (let idx = 0; idx < focusedColors.length - 1; idx++) { const pointA = colors[focusedColors[idx]]; const pointB = colors[focusedColors[idx + 1]]; const newPoints = createInterpolatedPoints(pointA, pointB); - if (forPreview) { - newColors.push(pointA, ...newPoints); - } else { - newColors.push(...newPoints); - } - } - if (forPreview) { - newColors.push(colors[focusedColors[focusedColors.length - 1]]); + newColors.push(pointA, ...newPoints); } + newColors.push(colors[focusedColors[focusedColors.length - 1]]); return newColors; } @@ -94,15 +89,13 @@