From f04679a42ef4dadd3ba919377550d98a11cce29e Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 31 May 2026 22:12:26 -0700 Subject: [PATCH] fix(common): pass radix 10 when parsing rgb() components in Color rgba/rgb CSS parsing used parseInt without a radix on captured digit groups. Add base 10 explicitly, matching getSafariVersion and other call sites in the codebase. Co-authored-by: Cursor --- src/common/Color.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/Color.ts b/src/common/Color.ts index aa3ca00ab..d416d670e 100644 --- a/src/common/Color.ts +++ b/src/common/Color.ts @@ -177,9 +177,9 @@ export namespace css { // Formats: rgb() or rgba() const rgbaMatch = css.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/); if (rgbaMatch) { - $r = parseInt(rgbaMatch[1]); - $g = parseInt(rgbaMatch[2]); - $b = parseInt(rgbaMatch[3]); + $r = parseInt(rgbaMatch[1], 10); + $g = parseInt(rgbaMatch[2], 10); + $b = parseInt(rgbaMatch[3], 10); $a = Math.round((rgbaMatch[5] === undefined ? 1 : parseFloat(rgbaMatch[5])) * 0xFF); return channels.toColor($r, $g, $b, $a); }