diff --git a/src/Themes/ui/ColorPicker/index.tsx b/src/Themes/ui/ColorPicker/index.tsx index 29181deac1..8b0e52c560 100644 --- a/src/Themes/ui/ColorPicker/index.tsx +++ b/src/Themes/ui/ColorPicker/index.tsx @@ -44,7 +44,15 @@ function parseHEXtoRGB(hex: string): RGB { }; } - if (hex.length == 7 || hex.length == 9) { + if (hex.length == 7) { + return { + r: Number.parseInt(`${hex[1]}${hex[2]}`, 16), + g: Number.parseInt(`${hex[3]}${hex[4]}`, 16), + b: Number.parseInt(`${hex[5]}${hex[6]}`, 16), + }; + } + + if (hex.length == 9) { return { r: Number.parseInt(`${hex[1]}${hex[2]}`, 16), g: Number.parseInt(`${hex[3]}${hex[4]}`, 16),