-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Labels
css-color-4Current WorkCurrent Work
Description
A discrepancy with "longer" hue handling was noticed in Color.js regarding its hue handling and the CSS spec. The conversation seemed to converge on the CSS specification maybe not handling this case correctly.
The current spec specifies longer as this:
if (0 < θ₂ - θ₁ < 180) {
θ₁ += 360;
}
else if (-180 < θ₂ - θ₁ < 0) {
θ₂ += 360;
}This seems to work fine in all cases except when θ₁ and θ₂ end up being identical. Cases like with 0deg and 360deg or 180deg and 540deg.
During discussions, it seems that maybe these cases were not being handled correctly. It also seems that a more descriptive approach as to the intent is needed as well to clear up confusion:
svgeesus commented [21 hours ago]color-js/color.js#136 (comment))
I think an issue should be raised on CSS Color 4:
- each hue fixup method should have a textual description, not just a bunch of mathematics, and
- the longer one has no reason for a discontinuity. The result is either 0, or it is 180 to 359.9999 which makes no sense as being the "longer" way round. Instead it should be 180 to 360.
Metadata
Metadata
Assignees
Labels
css-color-4Current WorkCurrent Work