Closed rdougan closed 59 minutes ago
'#aa0099 '
is considered invalid color. You should trim the string first:
decomposeColor('#aa0099 '.trim())
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
[!NOTE] @rdougan How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
Steps to reproduce
Steps:
Current behavior
Alpha value returned by
decomposeColor
isnull
when the color string passed has whitespace before/after value. Due to this,darken
(and probably other functions) returnNaN
when calculating proper values.Expected behavior
Trim whitespace, or give a warning in the console.
Context
No response
Your environment
``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```npx @mui/envinfo
Search keywords: decomposeColor darken NaN