-
Notifications
You must be signed in to change notification settings - Fork 268
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
alpha precision #174
Comments
I don't quite understand what you're asking - can you show some code with expected output and what you're really getting? |
So 2 hexa values produce the same object And of course when I'm trying to reconstitute the alpha value using the object I get the same result for both. "aa" which is not correct for #000000ab |
Wow, this is definitely a bug. Thank you for reporting. I'm actually surprised we support RGBA as the constructor - I don't remember that ever being the case (though it has been a while since I've worked on this module). I originally thought this could have been a precision error in the node prompt but doing a comparison of the two values shows that it is indeed the same value: Color("#000000ab").valpha == Color("#000000aa").valpha
> true |
Okay so digging deep into
I'll fix this in EDIT: npm has insanely aggressive caching now apparently, so the newly pushed |
Released as |
Thanks a lot. |
Hello,
When I parse hex values with alpha #000000aa
I get { model: 'rgb', color: [ 0, 0, 0 ], valpha: 0.67 }
The same valpha value is calculated for #000000ab
This is probably due to the rounding when converting from 255 base to 1 base.
Is there a way to access the intermediate 255 base value?
I understand the difference isn't much between both values, but the problem is that I can't retrieve the original hex value from the object... both giving #000000aa
Any idea?
The text was updated successfully, but these errors were encountered: