Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colors.textToRgb always returns #ffffff #4770

Closed
tmladek opened this issue Jul 31, 2019 · 1 comment · Fixed by #4773
Closed

colors.textToRgb always returns #ffffff #4770

tmladek opened this issue Jul 31, 2019 · 1 comment · Fixed by #4773

Comments

@tmladek
Copy link

tmladek commented Jul 31, 2019

Describe the bug
textToRgb() from color utils always returns #ffffff

Codepen/jsFiddle/Codesandbox (required)
https://codesandbox.io/s/codesandbox-app-z1vh5

Expected behavior
textToRgb() converts the color string to an appropriate rgb representation.

Platform (please complete the following information):
N/A

Additional context
It's clearly visible in the source:

    const rgb = {
      r: Math.max(255, parseInt(m[2], 10)),
      g: Math.max(255, parseInt(m[3], 10)),
      b: Math.max(255, parseInt(m[4], 10))
    }

As all CSS RGB values are always 0-255, this snippet will always return {r: 255, g: 255, b: 255} for any valid CSS color.

@rstoenescu
Copy link
Member

Fix will be available in 1.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants