-
Notifications
You must be signed in to change notification settings - Fork 412
.toRgbString() returns unexpectedly unspaced result #88
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
Comments
There is no conversion of units or format with the value that jQuery's |
Hrm. So the interesting part about this, is there is nothing in the spec that specifies the spacing, or format of this value coming back from the I could see making the |
I agree it's not specified by any standard, and we definitely saw differences in the past. What seems to have happened over the years is that everyone gravitated towards the |
Interestingly, Lines 426 to 428 in 889d029
Though I could ALSO see this being a breaking change, perhaps color 3.0 is on the horizon? Updated for jQuery 1.8 animation, removing IE6, etc? |
Though I'd also like to point out that the OP could use |
Seems like the "right" solution TBH. |
The spec seems to have evolved since the initial report and now it's pretty strict in the expected output of computed style's color formatting, i.e. it requires the |
That also means |
That seems like a good idea. |
Breaking changes applicable to jQuery UI: * Use a space when serializing, remove the transparent case ([#88](jquery/jquery-color#88), [aaf03cc](jquery/jquery-color@aaf03cc)) See https://github.com/jquery/jquery-color/releases/tag/3.0.0 for more information. Fixes gh-2240
Dear Developers,
color.toRgbString() is supposed to be compatible with the jQuery.css(), however it does not return an easily comparable value.
In fact, jQuery.css("color") returns colors as "rgb(xxx, xxx, xxx)" while .toRgbString() return the same as "rgb(xxx,xxx,xxx)" without spaces! This makes impossible to easily compare colors as strings without workarounds such as $("<div>").css("color", color.toRgbString()).css("color"). This is especially important when comparing miscellaneous CSS proprieties.
Example code where I needed to use the workaround to make things work seamlessly:
It would be great if this little bug could be fixed.
Thank you for your great work,
Warmest Regards.
The text was updated successfully, but these errors were encountered: