Skip to content

Commit 7301f92

Browse files
committed
[css-color-5] Clarify that relative color keywords can only be used if an origin color is specified
1 parent a7dbe90 commit 7301f92

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

css-color-5/Overview.bs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Adjusting colors: the ''color-adjust'' function {#coloradjust}
240240
Relative color syntax {#relative-colors}
241241
--------------------------------------------------------
242242

243-
Besides specifying absolute coordinates, all color functions can also be used with a *relative syntax* to produce colors in the function's target color space, based on an existing color. This syntax consists of the keyword `from`, a <<color>> value, and optionally numerical coordinates specific to the color function. To allow calculations on the original color's coordinates, there are single-letter keywords for each coordinate and `alpha` that corresponds to the color's alpha. If no coordinates are specified, the function merely converts the origin color to the target function's color space.
243+
Besides specifying absolute coordinates, all color functions can also be used with a *relative syntax* to produce colors in the function's target color space, based on an existing color (henceforth referred to as "origin color"). This syntax consists of the keyword `from`, a <<color>> value, and optionally numerical coordinates specific to the color function. To allow calculations on the original color's coordinates, there are single-letter keywords for each coordinate and `alpha` that corresponds to the color's alpha. If no coordinates are specified, the function merely converts the origin color to the target function's color space.
244244

245245
The following sections outline the relative color syntax for each color function.
246246

@@ -256,7 +256,7 @@ The grammar of the ''rgb()'' function is extended as follows:
256256
<dfn>&lt;alpha-value></dfn> = <<number>> | <<percentage>>
257257
</pre>
258258

259-
The following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
259+
When an origin color is present, the following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
260260

261261
- 'r' is a <<percentage>> that corresponds to the origin color's red channel after its conversion to sRGB
262262
- 'g' is a <<percentage>> that corresponds to the origin color's green channel after its conversion to sRGB
@@ -272,7 +272,7 @@ The grammar of the ''hsl()'' function is extended as follows:
272272
<dfn>&lt;hue></dfn> = <<number>> | <<angle>>
273273
</pre>
274274

275-
The following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
275+
When an origin color is present, the following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
276276

277277
- 'h' is a <<number>> that corresponds to the origin color's HSL hue after its conversion to sRGB, normalized to a [0, 360) range.
278278
- 's' is a <<percentage>> that corresponds to the origin color's HSL saturation after its conversion to sRGB
@@ -287,7 +287,7 @@ The grammar of the ''hwb()'' function is extended as follows:
287287
<dfn>hwb()</dfn> = hwb([from <<color>>]? <<hue>> <<percentage>> <<percentage>> [ / <<alpha-value>> ]? )
288288
</pre>
289289

290-
The following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
290+
When an origin color is present, the following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
291291

292292
- 'h' is a <<number>> that corresponds to the origin color's HWB hue after its conversion to sRGB
293293
- 'w' is a <<percentage>> that corresponds to the origin color's HWB whiteness after its conversion to sRGB
@@ -302,7 +302,7 @@ The grammar of the ''lab()'' function is extended as follows:
302302
<dfn>lab()</dfn> = lab([from <<color>>]? <<percentage>> <<number>> <<number>> [ / <<alpha-value>> ]? )
303303
</pre>
304304

305-
The following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
305+
When an origin color is present, the following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
306306

307307
- 'l' is a <<percentage>> that corresponds to the origin color's CIE Lightness
308308
- 'a' is a <<number>> that corresponds to the origin color's CIELab a axis
@@ -317,7 +317,7 @@ The grammar of the ''lch()'' function is extended as follows:
317317
<dfn>lch()</dfn> = lch([from <<color>>]? <<percentage>> <<number>> <<hue>> [ / <<alpha-value>> ]? )
318318
</pre>
319319

320-
The following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
320+
When an origin color is present, the following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
321321

322322
- 'l' is a <<percentage>> that corresponds to the origin color's CIE Lightness
323323
- 'c' is a <<number>> that corresponds to the origin color's LCH chroma
@@ -337,7 +337,7 @@ The grammar of the ''gray()'' function is extended as follows:
337337
<dfn>gray()</dfn> = gray([from <<color>>]? <<number>> [ / <<alpha-value>> ]? )
338338
</pre>
339339

340-
The following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
340+
When an origin color is present, the following keywords can also be used in this function (provided the end result conforms to the expected type for the parameter) and correspond to:
341341

342342
- 'l' is a <<percentage>> that corresponds to the origin color's CIE Lightness
343343
- 'alpha' is a <<percentage>> that corresponds to the origin color's alpha transparency

0 commit comments

Comments
 (0)