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

Update rgba regex to account for alpha #4006

Merged
merged 3 commits into from
Jun 14, 2017
Merged

Conversation

nickvans
Copy link
Contributor

@nickvans nickvans commented Jun 14, 2017

Previous regex would fail for an rgba string with a non integer alpha value. "rgba(255, 128, 64, .5)"

closes #4004

Previous regex would fail for an rgba string with a non integer alpha value. "rgba(255, 128, 64, .5)"
@asturur
Copy link
Member

asturur commented Jun 14, 2017

in this file
https://github.com/nickvans/fabric.js/blob/3422c01a6811f756cdeb4ebc37fde6821e9c7995/test/unit/color.js#L176

add a test like the one i underlined that parse a color with opacity .x instead of 0.x and verify that the value is read correctly.

And we are done

@asturur
Copy link
Member

asturur commented Jun 14, 2017

managed to do it

@nickvans
Copy link
Contributor Author

Thanks. I was trying to follow your instructions (I haven't contributed to a github project before) and when I followed the URL you gave me it told me I couldn't make changes unless I was in a branch. I made the change in my branch but couldn't figure out how to commit it so it would be added to the pull request. Thanks again for the help.

@asturur asturur merged commit 8cc52e0 into fabricjs:master Jun 14, 2017
asturur pushed a commit that referenced this pull request Jun 14, 2017
* Update rgba regex to account for alpha

Previous regex would fail for an rgba string with a non integer alpha value. "rgba(255, 128, 64, .5)"

* Create color.js

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

Successfully merging this pull request may close these issues.

canvas.toSVG fails for rgba colors
2 participants