Skip to content

Commit a132823

Browse files
committed
Reworded the premultiplied explanation note in the Color Stops section, per feedback from Brian Mantheos.
1 parent 62cb438 commit a132823

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

css3-images/Overview.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,16 +1031,17 @@ <h3 id=color-stop-syntax><span class=secno>5.4. </span> Gradient
10311031
rgba() 4-tuple, one can convert this to a premultiplied representation by
10321032
multiplying the red, green, and blue components by the alpha component.
10331033
For example, a partially-transparent blue may be given as
1034-
rgba(0,0,255,.5), which would then be expressed as (0,0,127.5,.5) in its
1035-
premultiplied representation. Note that fully opaque colors have the same
1036-
representation in rgba and premultiplied-rgba (you multiply the components
1037-
by 1), and all fully transparent colors are expressed the same way in the
1038-
premultiplied representation (you multiply each component by 0, so no
1039-
matter what the source color was in rgba, the premultiplied representation
1040-
is (0,0,0,0)). Interpolating colors using the premultiplied
1041-
representations rather than the plain rgba representations tends to
1042-
produce more attractive transitions, particularly when transitioning from
1043-
a fully opaque color to fully transparent.</p>
1034+
rgba(0,0,255,.5), which would then be expressed as [0, 0, 127.5, .5] in
1035+
its premultiplied representation. Interpolating colors using the
1036+
premultiplied representations rather than the plain rgba representations
1037+
tends to produce more attractive transitions, particularly when
1038+
transitioning from a fully opaque color to fully transparent. Note that
1039+
transitions where either the transparency or the color are held constant
1040+
(for example, transitioning between rgba(255,0,0,100%) and
1041+
rgba(0,0,255,100%) or rgba(255,0,0,100%) and rgba(255,0,0,0%)) have
1042+
identical results whether the color interpolation is done in premultiplied
1043+
or non-premultiplied color-space. Differences only arise when both the
1044+
color and transparency differ between the two endpoints.</p>
10441045
<!-- ====================================================================== -->
10451046

10461047
<h2 id=sizing><span class=secno>6. </span> Sizing Images and Objects in CSS</h2>

css3-images/Overview.src.html

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -774,15 +774,11 @@ <h3 id='color-stop-syntax'>
774774
one can convert this to a premultiplied representation by multiplying the
775775
red, green, and blue components by the alpha component. For example, a
776776
partially-transparent blue may be given as rgba(0,0,255,.5), which would
777-
then be expressed as (0,0,127.5,.5) in its premultiplied representation.
778-
Note that fully opaque colors have the same representation in rgba and
779-
premultiplied-rgba (you multiply the components by 1), and all fully
780-
transparent colors are expressed the same way in the premultiplied
781-
representation (you multiply each component by 0, so no matter what the
782-
source color was in rgba, the premultiplied representation is (0,0,0,0)).
777+
then be expressed as [0, 0, 127.5, .5] in its premultiplied representation.
783778
Interpolating colors using the premultiplied representations rather than
784779
the plain rgba representations tends to produce more attractive transitions,
785-
particularly when transitioning from a fully opaque color to fully transparent.</p>
780+
particularly when transitioning from a fully opaque color to fully transparent.
781+
Note that transitions where either the transparency or the color are held constant (for example, transitioning between rgba(255,0,0,100%) and rgba(0,0,255,100%) or rgba(255,0,0,100%) and rgba(255,0,0,0%)) have identical results whether the color interpolation is done in premultiplied or non-premultiplied color-space. Differences only arise when both the color and transparency differ between the two endpoints.</p>
786782

787783
<!-- ====================================================================== -->
788784

0 commit comments

Comments
 (0)