For the case of color-mix(in srgb, red 0%, blue 0%, green 100%), the color-mix() result calculation requires division by zero.
The issue happens in the first iteration of step 4.2.2 calculating (b’s percentage) / combined percentage). In the first iteration, a and b will be [red 0%] and [blue 0%], with a combined percentage of 0%.
My proposal would be to change the text of step 4.2.2, replacing:
"...with a progress percentage equal to (b’s percentage) / combined percentage)."
with
"with a progress percentage equal to (b’s percentage) / combined percentage) if combined percentage is greater than 0, and 0.5 otherwise."
(or something to that effect).
cc @svgeesus
For the case of
color-mix(in srgb, red 0%, blue 0%, green 100%), the color-mix() result calculation requires division by zero.The issue happens in the first iteration of step 4.2.2 calculating
(b’s percentage) / combined percentage). In the first iteration,aandbwill be[red 0%]and[blue 0%], with acombined percentageof 0%.My proposal would be to change the text of step 4.2.2, replacing:
"...with a progress percentage equal to
(b’s percentage) / combined percentage)."with
"with a progress percentage equal to
(b’s percentage) / combined percentage)ifcombined percentageis greater than 0, and 0.5 otherwise."(or something to that effect).
cc @svgeesus