From 81d1b6a77bd4a06a5cf0da4765ec35e988c1ad8f Mon Sep 17 00:00:00 2001 From: James Stuckey Weber Date: Mon, 4 Nov 2024 17:27:47 +0000 Subject: [PATCH] Show error if not a hex length --- src/lib/components/colors/Header.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/components/colors/Header.svelte b/src/lib/components/colors/Header.svelte index 77d3c36..28d3f12 100644 --- a/src/lib/components/colors/Header.svelte +++ b/src/lib/components/colors/Header.svelte @@ -46,6 +46,8 @@ // If it's possibly hex without a hash, add a hash and try again. if ([3, 4, 6, 8].includes(value.length)) { newColor = to(`#${value}`, targetSpace, { inGamut: true }); + } else { + throw error; } // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (errorWithHash) {