From 525812e3f1ef804795ca1058ab6bdea17076b1c2 Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Wed, 11 Dec 2024 17:23:00 +0000 Subject: [PATCH] Fix initial edge bug --- src/lib/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index f2e32a5..f432f6e 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -35,7 +35,7 @@ export const sliderGradient = ( hue: 'raw', maxDeltaE: 10, }); - let wasInGamut = false; + let wasInGamut: boolean; const inGamutSteps: string[] = []; const stepWidth = 100 / (gradientSteps.length - 1); @@ -45,13 +45,13 @@ export const sliderGradient = ( gradientSteps.forEach((step, index) => { if (inGamut(step, 'p3')) { - if (!wasInGamut) { + if (wasInGamut === false) { inGamutSteps.push(`transparent ${stepWidth * (index + 1)}%`); } wasInGamut = true; inGamutSteps.push(`${display(step)} ${stepWidth * index}%`); } else { - if (wasInGamut) { + if (wasInGamut === true) { inGamutSteps.push(`transparent ${stepWidth * (index - 1)}%`); } inGamutSteps.push(`transparent ${stepWidth * index}%`);