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

Fix color toHexa() #4579

Merged
merged 3 commits into from
Dec 27, 2017
Merged

Fix color toHexa() #4579

merged 3 commits into from
Dec 27, 2017

Conversation

jparkrr
Copy link
Contributor

@jparkrr jparkrr commented Dec 22, 2017

Need to strip out the decimals.

@jparkrr
Copy link
Contributor Author

jparkrr commented Dec 26, 2017

@asturur did you see this one? Currently color.toHexa() can give things like FFFFFF19.8

@asturur
Copy link
Member

asturur commented Dec 26, 2017

i saw it, but between wekeend and christmas i did not have time to check it

@@ -192,7 +192,7 @@
var source = this.getSource(), a;

a = source[3] * 255;
a = a.toString(16);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we use math.Round on source[3] * 255 instead of using a split string?

@jparkrr
Copy link
Contributor Author

jparkrr commented Dec 27, 2017

@asturur Great idea on rounding! Updated

Sorry if I rushed you, take your time. Hope you had a good Christmas!

@asturur asturur merged commit 4846789 into fabricjs:master Dec 27, 2017
@jparkrr jparkrr deleted the hexa-fix branch December 27, 2017 13:58
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this pull request Nov 18, 2019
* Failing Color.toHexa() test

* fix color toHexa() to not give decimals

* fix hexa test due to rounding
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.

2 participants