Skip to content

Commit

Permalink
[css-color] Export term premultiplied, link to it consistently #11238
Browse files Browse the repository at this point in the history
  • Loading branch information
svgeesus committed Nov 26, 2024
1 parent 45c9b0f commit 2c6c996
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions css-color-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4595,9 +4595,9 @@ Color Interpolation</h2>
</li>
<li>(if required) re-inserting [=carried forward=] values in the converted colors</li>
<li>(if required) fixing up the hues, depending on the selected <<hue-interpolation-method>></li>
<li>changing the color components to premultiplied form</li>
<li>changing the color components to [=premultiplied=] form</li>
<li>linearly interpolating each component of the computed value of the color separately</li>
<li>undoing premultiplication</li>
<li>undoing [=premultiplied|premultiplication=]</li>
</ol>


Expand Down Expand Up @@ -4894,7 +4894,7 @@ Interpolating with Missing Components</h3>
</div>

If the carried forward [=missing component=]
is alpha, the color must be premultiplied with this carried forward value,
is alpha, the color must be [=premultiplied=] with this carried forward value,
not with the zero value that would have resulted from color conversion.

<div class="example" id="ex-oklch-missing-alpha">
Expand Down Expand Up @@ -4926,15 +4926,15 @@ Interpolating with Missing Components</h3>
Interpolating with Alpha</h3>

When the colors to be interpolated are not fully opaque,
they are transformed into <dfn export>premultiplied color values</dfn>
they are first <dfn export>premultiplied</dfn>
as follows:

* If the alpha value is ''none'', the premultiplied value is the un-premultiplied value. Otherwise,
* If any component value is ''none'', the premultiplied value is also ''none''.
* For [=rectangular orthogonal color=] coordinate systems, all component values are multiplied by the alpha value.
* For [=cylindrical polar color=] coordinate systems, the hue angle is <em>not</em> premultiplied, but the other two axes are premultiplied.
* For [=cylindrical polar color=] coordinate systems, the hue angle is <em>not</em> premultiplied, but the other two axes <em>are</em> premultiplied.

To obtain a color value from a premultipled color value,
To obtain a color value from a premultiplied color value,

* If the interpolated alpha value is zero or ''none'',
the un-premultiplied value is the premultiplied value. Otherwise,
Expand Down
6 changes: 3 additions & 3 deletions css-color-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -503,21 +503,21 @@ The choice of mixing color space can have a large effect on the end result.
So far, all the ''color-mix()'' examples
have used fully opaque colors.
To simplify the examples,
the premultilication and unpremultiplication steps
the [=premultiplied|premultilication=] and unpremultiplication steps
were omitted
because these would simply multiply by 1, and divide by 1,
so the result would be unchanged.

In the general case,
colors may have non-unity alpha components
and thus the premultiply, interpolate, unpremultiply steps
and thus the [=premultiplied|premultiply=], interpolate, unpremultiply steps
must not be omitted.

<div class="example" id="ex-premultiply-srgb">
This example is 25% semi-opaque red
and 75% semi-opaque green.
mixed in sRGB.
Both the correct (premultiplied)
Both the correct ([=premultiplied=])
and incorrect (non-premultiplied)
workings are shown.

Expand Down

0 comments on commit 2c6c996

Please sign in to comment.