From f56154ede691f5d6780cf478cf6d31a1e39c9d00 Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Thu, 9 Feb 2023 09:56:52 -0500 Subject: [PATCH] Fixes color parser --- src/system/color.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/color.ts b/src/system/color.ts index 5d95fbe..992afd5 100644 --- a/src/system/color.ts +++ b/src/system/color.ts @@ -692,16 +692,16 @@ export function parseColor(value: string): Color | null { return null; } - const mode = result[3]; + const mode = result[1]; let colors: number[]; switch (mode) { case 'rgb': case 'hsl': - colors = [parseInt(result[4], 10), parseInt(result[5], 10), parseInt(result[6], 10), 1]; + colors = [parseInt(result[2], 10), parseInt(result[3], 10), parseInt(result[4], 10), 1]; break; case 'rgba': case 'hsla': - colors = [parseInt(result[4], 10), parseInt(result[5], 10), parseInt(result[6], 10), parseFloat(result[7])]; + colors = [parseInt(result[2], 10), parseInt(result[3], 10), parseInt(result[4], 10), parseFloat(result[5])]; break; default: return null;