You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 27, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: content/css/concepts/colors/terms/lch/lch.md
+18-5Lines changed: 18 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,18 @@ CatalogContent:
14
14
- 'paths/front-end-engineer-career-path'
15
15
---
16
16
17
-
The **`lch()`** function defines colors using the LCH (Lightness, Chroma, Hue) color space, which provides a more perceptually uniform way to represent colors compared to traditional RGB or HSL color spaces.
17
+
The **`lch()`** function defines colors using the LCH (Lightness, Chroma, Hue) color space, which provides a uniform way to represent colors compared to traditional RGB or HSL color spaces.
18
18
19
19
## Syntax
20
20
21
21
```pseudo
22
-
<property>: lch(lightness chroma hue);
22
+
<property>: lch(lightness chroma hue / alpha);
23
23
```
24
24
25
25
-`lightness`: A percentage value from `0%` to `100%`. Represents the brightness of the color. `0%` is completely black, `100%` is completely white, and `50%` represents the mid-tone.
26
26
-`chroma`: A number value (typically `0` to `150` or higher). Represents the colorfulness or intensity of the color. `0` represents a neutral gray with no color, while higher values represent more vivid colors.
27
-
-`hue`: A unitless number value representing an angle in the color wheel from `0` to `360`. `0` represents red, `120` represents green, and `240` represents blue.
27
+
-`hue`: An angle value on the color wheel. It can be given with units like `deg`, `rad`, or `turn`, or as a unitless number interpreted as degrees. Angles wrap, so they are not limited to `0`–`360`; for reference, `0deg` represents red, `120deg` represents green, and `240deg` represents blue.
28
+
-`alpha` (optional): A number from `0` to `1`, or a percentage from `0%` to `100%`, representing the opacity of the color. `0` (or `0%`) is fully transparent, `1` (or `100%`) is fully opaque. Defaults to `1` if omitted.
28
29
29
30
## Example 1
30
31
@@ -36,7 +37,7 @@ h1 {
36
37
37
38
Sets the font color of the `h1` element to a vibrant orange-yellow color with medium lightness:
38
39
39
-

40
+

40
41
41
42
## Example 2
42
43
@@ -48,4 +49,16 @@ p {
48
49
49
50
Sets the font color of the `p` element to a light purple color with moderate chroma:
50
51
51
-

52
+

53
+
54
+
## Example 3
55
+
56
+
```css
57
+
div {
58
+
background-color: lch(60%80120 / 0.5);
59
+
}
60
+
```
61
+
62
+
Sets the background color of the `div` element to a semi-transparent green color with 50% opacity:
63
+
64
+

0 commit comments