diff --git a/packages/theming/src/color-calculation.js b/packages/theming/src/color-calculation.js index 3f9508200..baede2088 100644 --- a/packages/theming/src/color-calculation.js +++ b/packages/theming/src/color-calculation.js @@ -15,7 +15,8 @@ const defaultLuminanceMap = { }; const extractRGB = str => { - const match = str.match(/,\s*([\d\s]+)\s*\)/); + const parts = str.split(',').filter(part => /\d/.test(part)); + const match = parts[1]?.match(/(\d[\d\s]*)\s*\)/); return match ? match[1] : null; };