-
Notifications
You must be signed in to change notification settings - Fork 439
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
Decimals are rounded (rgb(...) -> toRgb
)
#278
Comments
The code looks like it's rounding intentionally: Lines 132 to 139 in 13851a7
Just curious, what's the reason for rounding? In CSS, decimal numbers are valid. Is there another concern? Would you be open to either removing the rounding or adding a My use case is data transformation. I'm getting data from a server where the colors are in an RGB object format. I transform them into CSS colors for the web UI, where a user can edit the colors and save them back to the server. So the pipeline is |
Ah, I see not all older browsers support float values in rgb expressions: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb#browser_compatibility Is a PR welcome for implementing Reasoning: RGB values can be used for other things besides CSS expressions, so there's value in preserving decimal places. |
Anyone here? |
This code produces rounded output:
25.5
was rounded to26
.Is the rounding intentional?
See this PR which adds a failing unit test: #277
The text was updated successfully, but these errors were encountered: