You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somewhat related to #82, but I believe a change in defaults should be considered rather than an option ; at least in the color.minify function, which is used by default in tools like cssnano (this was reported in cssnano/cssnano#1515).
Conversions to HSL currently round all values to the nearest integer. This leaves it with less precision than the standard 8bit rgb format, used to store the color internally. This means some colors cannot be represented uniquely and get the same hsl values as nearby colors, and therefore the minification is not lossless (which seems to be the intent).
For example, rgb(14 14 14 / 50%) is converted to hsl(0, 0%, 5%, .5), which when converted back is rgb(13 13 13 / 50%).
I believe rounding HSL values to 1 digit precision would solve this.
The text was updated successfully, but these errors were encountered:
Somewhat related to #82, but I believe a change in defaults should be considered rather than an option ; at least in the
color.minify
function, which is used by default in tools like cssnano (this was reported in cssnano/cssnano#1515).Conversions to HSL currently round all values to the nearest integer. This leaves it with less precision than the standard 8bit rgb format, used to store the color internally. This means some colors cannot be represented uniquely and get the same hsl values as nearby colors, and therefore the minification is not lossless (which seems to be the intent).
For example,
rgb(14 14 14 / 50%)
is converted tohsl(0, 0%, 5%, .5)
, which when converted back isrgb(13 13 13 / 50%)
.I believe rounding HSL values to 1 digit precision would solve this.
The text was updated successfully, but these errors were encountered: