-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[BUG] Colors not being rendered when alpha is expressed in scientific notation #3823
Comments
I think this would be better filed against https://github.com/chartjs/chartjs-color or even better, https://github.com/Qix-/color |
@etimberg A little off-topic, but since the repositories were handed off to moox and then myself by harthur, they have become active again. Did you guys fork for redundancy, or would the ChartJS be interested in PRing whatever relevant changes it'd need and updating to the new versions? |
@Qix- we had initially had a fork because we made some internal changes to make it build in our old build process (before browserify) so we had to wrap the dependencies in UMD headers. We also have a dependency on chartjs/chartjs-color-string because we needed to change the regex that detects when a string is a color. chartjs/chartjs-color-string@4a7753e Previously, if the string was We've since made some performance changes (removing removing redundant clipping checks was on that springs to mind). See chartjs/chartjs-color@4fb3e10 and chartjs/chartjs-color@2b50dd2 |
The regex change you made in chartjs/chartjs-color-string@4a7753e should definitely be pulled back into the main repo (not sure why Those |
When defining a color using RGBA, it's not rendered if the alpha component is expressed using scientific notation.
A candidate fix could be redefining the rgba regex used in getRgba function to the following:
/^rgba?(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+(e[+-]\d+)?)\s*)?)$/
The text was updated successfully, but these errors were encountered: