For example:
color-mix(in hsl, hsl(30deg 40% 80% / 25%), hsl(90deg 0 80% / 25%))
color-mix(in hsl, hsl(30deg 40% 80% / 25%), hsl(90deg none 80% / 25%))
In both cases browsers do a linear interpolation between 30deg and 90deg while in my implementation the 90deg is powerless and becomes missing. This missing hue is then filled in with the 30deg from the other color.
I suggest rewriting section 13 to make it clearer what all the steps are.
- changing any powerless components to missing values
This step seems redundant as it is already included in https://drafts.csswg.org/css-color-4/#color-conversion
Add a step between what is now 4. and 5. for "the missing component is treated as having the other color’s component value"
or maybe at another position in the sequence?
With those suggestions the spec text would be become:
- checking the two colors for analogous components and analogous sets which will be carried forward
- converting them both to a given color space which will be referred to as the interpolation color space below.
- (if required) re-inserting carried forward values in the converted colors
- fill in missing components with the other color's component values
- (if required) fixing up the hues, depending on the selected <hue-interpolation-method>
- changing the color components to premultiplied form
- linearly interpolating each component of the computed value of the color separately
- undoing premultiplication
If color space conversion (and there for powerless to missing) is actually intended to be a conditional step, then step 2. should explicitly state this.
For example:
- (if required) converting them both to a given color space which will be referred to as the interpolation color space below.
With this last change I think the spec would match browser behavior.
No idea if we actually want to change the spec to match :)
@svgeesus @weinig
For example:
color-mix(in hsl, hsl(30deg 40% 80% / 25%), hsl(90deg 0 80% / 25%))color-mix(in hsl, hsl(30deg 40% 80% / 25%), hsl(90deg none 80% / 25%))In both cases browsers do a linear interpolation between
30degand90degwhile in my implementation the90degis powerless and becomes missing. This missing hue is then filled in with the30degfrom the other color.I suggest rewriting section 13 to make it clearer what all the steps are.
This step seems redundant as it is already included in https://drafts.csswg.org/css-color-4/#color-conversion
Add a step between what is now 4. and 5. for "the missing component is treated as having the other color’s component value"
or maybe at another position in the sequence?
With those suggestions the spec text would be become:
If color space conversion (and there for powerless to missing) is actually intended to be a conditional step, then step 2. should explicitly state this.
For example:
With this last change I think the spec would match browser behavior.
No idea if we actually want to change the spec to match :)
@svgeesus @weinig