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

reHSLa and reRGBa ignore case #5017

Merged
merged 7 commits into from
Jun 2, 2018
Merged

reHSLa and reRGBa ignore case #5017

merged 7 commits into from
Jun 2, 2018

Conversation

durga598
Copy link
Contributor

@durga598 durga598 commented Jun 1, 2018

ignore case for rgba and hsla, as if pass in uppercase it was returning default color

fabric.Color.reRGBa regex ignore case
ignore case for hsla
 fabric.Color.reRGBa regex ignore case
@asturur
Copy link
Member

asturur commented Jun 1, 2018

I think this is OK.

@asturur
Copy link
Member

asturur commented Jun 1, 2018

Do you mind adding a small test to the suite to test it?

like at file test/unit/color.js
dduplicate the test at line 176 making it with uppercase and do the same for an hsla test.

added test case for RGB/RGBA and HSL/HSLA (uppercase)
@durga598
Copy link
Contributor Author

durga598 commented Jun 2, 2018

I added.

oColor.setSource([255,255,255,0.8]);
assert.equal(oColor.toHexa(), 'FFFFFFCC');
oColor.setSource([255,255,255,0.1]);
assert.equal(oColor.toHexa(), 'FFFFFF1A');
Copy link
Member

Choose a reason for hiding this comment

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

can i ask you the reason of this change here? i remember this one was here because of weird decimals.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed that to original

@asturur asturur merged commit 87d67eb into fabricjs:master Jun 2, 2018
@asturur asturur mentioned this pull request Jun 6, 2018
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this pull request Nov 18, 2019
* fabric.Color.reRGBa regex ignore case

ignore case for rgba

* fabric.Color.reHSLa ignore case

ignore case for hsla

* test case RGBA / HSLA

added test case for RGB/RGBA and HSL/HSLA (uppercase)

* Update color.js
This pull request was closed.
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