-
Notifications
You must be signed in to change notification settings - Fork 63
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
rgba Color Values are incorrect #50
Comments
I´ve seen this before but totally forgot about it. Indeed your findings seem to be the root of the issue. |
While specifications CSS2 Color and CSS3 Color define the computed value to be formatted "as specified", no browser reliably does this at this point. I'm not sure I like the notion of testing for a given color in the first place. I'd argue that you should be testing for an element being in a given state (certain class name present, data-attribute filled, etc). But if you must check for a specific style, you'll have to deal with the short comings of computedValue() yourself. For colors I can recommend chromath for working with colors and this SO question might help with creating a fuzzy color compare function |
I've had to deal with these comparisons myself in the color library I wrote because I use floating point representations internally. This is how I solved it: https://github.com/One-com/one-color#comparing-color-objects |
my rgba values don't even work on phantom 3 |
I have searched a lot for this issue, and i know that the Problem isn't dalekjs but maybe there is a solution for this.
Webdriver/the Browser gives 'wrong' rgba values.
For example if you write something like this.
'backgroundcolor is correct': function (test) { test.open(url) .assert.css('.backgroundStripe', 'background-color', 'rgba(98, 202, 217, 0.7)', 'backgroundStripe has right color') .done(); }
Instead of the expected (and in the stylesheet defined) value
rgba(98, 202, 217, 0.7)
phantomjs returnsrgba(98, 202, 217, 0.699219)
and chrome returnsrgba(98, 202, 217, 0.701961)
I think the reason why this happend is:
http://stackoverflow.com/a/13754993/3233058
Maybe there is a simple solution for this, but i haven't found one.
Versions i used:
The text was updated successfully, but these errors were encountered: