Skip to content

Commit 90e952e

Browse files
committed
[css-color-5] Recover text defining adjusters that was removed from color-mix and move it to color-adjust
1 parent ceda934 commit 90e952e

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

css-color-5/Overview.bs

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,47 @@ Adjusting colors: the ''color-adjust'' function {#coloradjust}
555555
Multiple color functions can be specified.
556556

557557
<pre class='prod'>
558-
<dfn>color-adjust()</dfn> = color-adjust( <<color>> [ color-adjuster [ in <<colorspace>> ]? ]? )
558+
<dfn>color-adjust()</dfn> = color-adjust( <<color>> [ <<color-adjuster>> && [ in <<colorspace>> ]? ]? )
559559
</pre>
560560

561+
<pre class='prod'>
562+
<dfn>&lt;color-adjuster></dfn> = [ [
563+
<<srgb-adjuster>> | <<hsl-adjuster>> | <<hwb-adjuster>>
564+
| <<xyz-adjuster>> | <<lab-adjuster>> | <<lch-adjuster>>
565+
] | alpha ] <<percentage>>?
566+
<dfn>&lt;srgb-adjuster></dfn> = red || green || blue
567+
<dfn>&lt;hsl-adjuster></dfn> = <<hue-adjuster>> || saturation || lightness
568+
<dfn>&lt;hwb-adjuster></dfn> = <<hue-adjuster>> || whiteness || blackness
569+
<dfn>&lt;xyz-adjuster></dfn> = x || y || z
570+
<dfn>&lt;lab-adjuster></dfn> = lightness || a || b
571+
<dfn>&lt;lch-adjuster></dfn> = lightness || chroma || <<hue-adjuster>>
572+
<dfn>&lt;hue-adjuster></dfn> = hue [shorter | longer | increasing | decreasing | specified ]?
573+
</pre>
574+
575+
The meaning of the adjusters is defined by colorspace.
576+
For example, if the [=colorspace=] is [=hsl=],
577+
hue means the HSL hue, which is not the same as the LCH hue;
578+
if the colorspace is [=lch=],
579+
lightness means the LCH Lightness, which is the same as Lab lightness,
580+
but different to the HSL Lightness.
581+
582+
Only the [=color-adjuster=]s defined for a given [=colorspace=] are available.
583+
For example, it is not possible to use the HWB [=whiteness=] adjuster unless the colorspace is [=hwb=].
584+
The alpha adjuster is available on any [=colorspace=].
585+
586+
Note: not all [=color-adjuster=]s are equally useful.
587+
Adjustments in LCH are the most useful, which is why it is the default.
588+
Adjustments on the a and b axes are rarely needed.
589+
Adjustments in the srgb-related spaces (srgb itself, hsl, hwb)
590+
are provided mainly for backward compatibility
591+
with the sorts of adjustments currently done in CSS preprocessors.
592+
Adjusting the individual x, y and z channels will produce significant hue shifts;
593+
however, adjusting all three channels together is useful
594+
and will lighten or darken the color.
595+
596+
The [=hue-adjuster=] takes optional keywords, to specify the [[css-color-4#hue-interpolation]] algorithm.
597+
If no keyword is specified, it is as if ''shorter'' were specified.
598+
561599
<div class="example">
562600
This example produces the adjustment of peru (#CD853F),
563601
in ''lch()'' colorspace (the default),

0 commit comments

Comments
 (0)