From 504e0256a2fcc6b7a1c36a0e9d1b9e0c9989c5a4 Mon Sep 17 00:00:00 2001 From: David Harvey Date: Tue, 16 Dec 2025 07:47:20 -0500 Subject: [PATCH] Fix incorrect conversion of rgba to hex8 in color picker (#6672) * Fix incorrect conversion of rgba to hex8 in color picker * Fix parsing of hex8 strings too --- packages/core/src/utils/ColorPicker.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/utils/ColorPicker.ts b/packages/core/src/utils/ColorPicker.ts index 7e415239a..8ec90f938 100644 --- a/packages/core/src/utils/ColorPicker.ts +++ b/packages/core/src/utils/ColorPicker.ts @@ -1818,10 +1818,10 @@ export default function ($, undefined?: any) { // Returns an 8 character hex function rgbaToHex(r, g, b, a) { var hex = [ - pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16)), + pad2(convertDecimalToHex(a)), ]; return hex.join(''); @@ -2406,10 +2406,10 @@ export default function ($, undefined?: any) { } if ((match = matchers.hex8.exec(color))) { return { - a: convertHexToDecimal(match[1]), - r: parseIntFromHex(match[2]), - g: parseIntFromHex(match[3]), - b: parseIntFromHex(match[4]), + r: parseIntFromHex(match[1]), + g: parseIntFromHex(match[2]), + b: parseIntFromHex(match[3]), + a: convertHexToDecimal(match[4]), format: named ? 'name' : 'hex8', }; }