-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OKLCH and OKLab functions to reference (#15033)
* Add OKLCH and OKLab functions to reference * Add oklab() function page * Copy lab redirects for oklab * Add oklch() page * Apply suggestions from code review Co-authored-by: Onkar Ruikar <87750369+OnkarRuikar@users.noreply.github.com> Co-authored-by: Onkar Ruikar <87750369+OnkarRuikar@users.noreply.github.com>
- Loading branch information
1 parent
6dfb0e4
commit 608d658
Showing
4 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: oklab() | ||
slug: Web/CSS/color_value/oklab | ||
tags: | ||
- CSS | ||
- CSS Data Type | ||
- Data Type | ||
- Reference | ||
- Web | ||
- color | ||
- oklab | ||
- Experimental | ||
browser-compat: css.types.color.oklab | ||
--- | ||
{{CSSRef}} | ||
|
||
The **`oklab()`** functional notation expresses a given color in the Oklab color space. Oklab represents the entire range of color that humans can see. | ||
|
||
## Syntax | ||
|
||
```css | ||
oklab(40.1% 0.1143 0.045); | ||
oklab(59.69% 0.1007 0.1191); | ||
oklab(59.69% 0.1007 0.1191 / .5); | ||
``` | ||
|
||
### Values | ||
|
||
- Functional notation: `oklab(L a b [/ A])` | ||
|
||
- : `L` specifies the perceived lightness, and is a {{cssxref("<percentage>")}} between `0%` representing black and `100%` representing white. | ||
|
||
The second argument `a` is the distance along the `a` axis in the Oklab colorspace. | ||
|
||
The third argument `b` is the distance along the `b` axis in the Oklab colorspace. | ||
|
||
`A` (alpha) can be a {{cssxref("<number>")}} between `0` and `1`, or a {{cssxref("<percentage>")}}, where the number `1` corresponds to `100%` (full opacity). | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- [A perceptual color space for image processing](https://bottosson.github.io/posts/oklab/) | ||
- [Safari Technology Preview 137 release notes](https://webkit.org/blog/12156/release-notes-for-safari-technology-preview-137/): includes `oklab()` and {{cssxref("color_value/oklch",'oklch()')}} colors. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: oklch() | ||
slug: Web/CSS/color_value/oklch | ||
tags: | ||
- CSS | ||
- CSS Data Type | ||
- Data Type | ||
- Reference | ||
- Web | ||
- color | ||
- oklch | ||
- Experimental | ||
browser-compat: css.types.color.oklch | ||
--- | ||
{{CSSRef}} | ||
|
||
The **`oklch()`** functional notation expresses a given color in the OKLCH color space. It has the same L axis as {{cssxref("color_value/oklab","oklab()")}}, but uses polar coordinates C (Chroma) and H (Hue). | ||
|
||
## Syntax | ||
|
||
```css | ||
oklch(40.1% 0.123 21.57) | ||
oklch(59.69% 0.156 49.77) | ||
oklch(59.69% 0.156 49.77 / .5) | ||
``` | ||
|
||
### Values | ||
|
||
- Functional notation: `oklch(L C H [/ A])` | ||
|
||
- : `L` specifies the perceived lightness, and is a {{cssxref("<percentage>")}} between `0%` representing black and `100%` representing white. | ||
|
||
The second argument `C` is the chroma (roughly representing the "amount of color"). Its minimum useful value is 0, while its maximum is theoretically unbounded (but in practice does not exceed 0.4). | ||
|
||
The third argument `H` is the hue angle. `0deg` points along the positive "a" axis (toward purplish red), `90deg` points along the positive "b" axis (toward mustard yellow), `180deg` points along the negative "a" axis (toward greenish cyan), and `270deg` points along the negative "b" axis (toward sky blue). | ||
|
||
`A` (alpha) can be a {{cssxref("<number>")}} between `0` and `1`, or a {{cssxref("<percentage>")}}, where the number `1` corresponds to `100%` (full opacity). | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- [A perceptual color space for image processing](https://bottosson.github.io/posts/oklab/) | ||
- [Safari Technology Preview 137 release notes](https://webkit.org/blog/12156/release-notes-for-safari-technology-preview-137/): includes `oklch()` and {{cssxref("color_value/oklab",'oklab()')}} colors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters