Skip to content

Commit 5097ff6

Browse files
committed
[css-color-4] consistently name color-mod()
This avoids confusion with the very real color() function
1 parent a321974 commit 5097ff6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

css-color-4/Overview.bs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,7 +2310,7 @@ Modifying Colors: the ''color-mod()'' function</h2>
23102310
Issue: Actually add the CNS thing.
23112311

23122312
<pre class='prod'>
2313-
<dfn>color-mod()</dfn> = color( [ <<color>> | <<hue>> ] <<color-adjuster>>* )
2313+
<dfn>color-mod()</dfn> = color-mod( [ <<color>> | <<hue>> ] <<color-adjuster>>* )
23142314
<dfn>&lt;color-adjuster></dfn> =
23152315
[red( | green( | blue( | alpha( | a(] ['+' | '-']? [<<number>> | <<percentage>>] ) |
23162316
[red( | green( | blue( | alpha( | a(] '*' <<percentage>> ) |
@@ -2343,7 +2343,7 @@ Modifying Colors: the ''color-mod()'' function</h2>
23432343
Each <<color-adjuster>> modifies the color in some way,
23442344
passing a new |base color| to the next <<color-adjuster>> in the list.
23452345
The same <<color-adjuster>> can be specified more than once in the list,
2346-
such as ''color(red s(- 10%) s(- 10%))'';
2346+
such as ''color-mod(red s(- 10%) s(- 10%))'';
23472347
each instance just modifies the color appropriately
23482348
(in this case, producing ''hsl(0deg, 80%, 50%)'').
23492349

@@ -2388,7 +2388,7 @@ Modifying Colors: the ''color-mod()'' function</h2>
23882388
<div class='example'>
23892389
For example, here's a possible ''color-mod()'' function that lightens and brightens the |base color|:
23902390

2391-
<pre class="lang-css">color(X w(+ 20%) s(+ 20%))</pre>
2391+
<pre class="lang-css">color-mod(X w(+ 20%) s(+ 20%))</pre>
23922392

23932393
If X is a color like ''blue'',
23942394
this works in the expected way -
@@ -2471,7 +2471,7 @@ RGBA Adjustment</h3>
24712471
are applied as adjustments to the |base color|.
24722472

24732473
<div class='example'>
2474-
For example, in ''color(red rgb(+ #004400))'',
2474+
For example, in ''color-mod(red rgb(+ #004400))'',
24752475
the |base color| is ''red'' (''#ff0000'').
24762476
The red and blue channels aren't adjusted at all
24772477
(those channels in the given color are both 0),
@@ -2540,7 +2540,7 @@ HSL/HWB Adjustment</h3>
25402540
and the adjuster would make the sum of whiteness and blackness less than 100%,
25412541
it additionally adjusts the opposite HWB channel
25422542
to make the sum equal to 100%.
2543-
(That is, ''color(white w(- 20%))'' would represent the same color as ''hwb(0, 80%, 20%)''.)
2543+
(That is, ''color-mod(white w(- 20%))'' would represent the same color as ''hwb(0, 80%, 20%)''.)
25442544
</dl>
25452545

25462546

@@ -2595,10 +2595,10 @@ Color Blending: the ''blend'' and ''blenda'' adjusters</h3>
25952595
then the components are blended.
25962596

25972597
<div class='example'>
2598-
For example, ''color(yellow blend(blue 50%))'' blends yellow (''#ffff00'') with blue (''#0000ff'') equally,
2598+
For example, ''color-mod(yellow blend(blue 50%))'' blends yellow (''#ffff00'') with blue (''#0000ff'') equally,
25992599
resulting in ''#808080'', a medium gray.
26002600

2601-
On the other hand, ''color(yellow blend(blue 50% hsl))'' blends the same colors in HSL space,
2601+
On the other hand, ''color-mod(yellow blend(blue 50% hsl))'' blends the same colors in HSL space,
26022602
where yellow is ''hsl(60, 100%, 50%)'' and blue is ''hsl(240, 100%, 50%)'',
26032603
which results in ''hsl(150, 100%, 50%)'', a fully-saturated shade of green.
26042604
</div>
@@ -2729,7 +2729,7 @@ Guaranteeing Adequate Contrast: the ''contrast'' adjuster</h3>
27292729

27302730
<li>
27312731
Blend the |minimum-contrast color| and |maximum-contrast color| according to the specified <<percentage>>,
2732-
as if ''color(|maximum-contrast color| blend(|minimum-contrast color| <<percentage>> hwb))'' were specified.
2732+
as if ''color-mod(|maximum-contrast color| blend(|minimum-contrast color| <<percentage>> hwb))'' were specified.
27332733
Return the blended color.
27342734
</ol>
27352735
</dl>

0 commit comments

Comments
 (0)