Skip to content

Commit 8d3a6c4

Browse files
committed
[css-color-5] Flesh out adjuster normalization logic for color-mix() further
1 parent 1b0ad96 commit 8d3a6c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

css-color-5/Overview.bs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ Arguments are normalized as follows:
124124
it is expanded to all adjusters available for the given [=colorspace=] plus alpha.
125125
2. If a percentage is omitted and there are no adjusters present on any color arguments,
126126
it defaults to 50% (an equal mix of the two colors).
127-
3. If only some adjusters are present, the remaining ones default to 0% (i.e. the corresponding components are taken from the first color).
128-
4. If the sum of corresponding adjusters across all colors is not 100%, percentages are scaled proportionally so that the sum is exactly 100%.
127+
3. Adjusters that are not present on **any** color default to 0% (i.e. the corresponding components are taken from the first color).
128+
4. Adjusters that are only present on one of the colors default to <code>100% - <i>p</i></code> on the second color,
129+
where <i>p</i> is the percentage of the corresponding adjuster in the other color.
130+
5. If the sum of corresponding adjusters across all colors is not 100%, percentages are scaled proportionally so that the sum is exactly 100%.
129131

130132
Issue: Do missing adjusters default to 0% everywhere, or only in the second color?
131133
If the former, we can end up with adjusters that sum to 0% pretty easily.

0 commit comments

Comments
 (0)