Skip to content

Commit

Permalink
Merge branch 'mdn:main' into 404-learn
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmth authored Mar 14, 2024
2 parents 607e7c3 + b59c2c5 commit 0115d62
Show file tree
Hide file tree
Showing 225 changed files with 955 additions and 968 deletions.
4 changes: 3 additions & 1 deletion files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
/en-US/docs/Accessibility_FAQ /en-US/docs/Web/Accessibility
/en-US/docs/Accessibility_Information_for_Web_Authors /en-US/docs/Web/Accessibility/Information_for_Web_authors
/en-US/docs/Accessible_DHTML /en-US/docs/Web/Accessibility/ARIA
/en-US/docs/Adapting_XUL_Applications_for_Firefox_1.5 /en-US/docs/Mozilla/Firefox/Releases/1.5/Adapting_XUL_Applications_for_Firefox_1.5
/en-US/docs/Adapting_XUL_Applications_for_Firefox_1.5 /en-US/docs/Mozilla/Firefox/Releases/1.5
/en-US/docs/Adding_2D_content_to_a_WebGL_context /en-US/docs/Web/API/WebGL_API/Tutorial/Adding_2D_content_to_a_WebGL_context
/en-US/docs/Adding_Extensions_using_the_Windows_Registry https://extensionworkshop.com/documentation/publish/signing-and-distribution-overview/
/en-US/docs/Adding_feed_readers_to_Firefox /en-US/docs/Mozilla/Firefox/Releases/2/Adding_feed_readers_to_Firefox
Expand Down Expand Up @@ -5799,6 +5799,7 @@
/en-US/docs/Mozilla/Firefox/Privacy/Storage_Access_Policy/Errors/CookieBlockedTracker /en-US/docs/Web/Privacy/Storage_Access_Policy/Errors/CookieBlockedTracker
/en-US/docs/Mozilla/Firefox/Privacy/Storage_Access_Policy/Errors/CookiePartitionedForeign /en-US/docs/Web/Privacy/Storage_Access_Policy/Errors/CookiePartitionedForeign
/en-US/docs/Mozilla/Firefox/Privacy/Tracking_Protection /en-US/docs/Web/Privacy/Firefox_tracking_protection
/en-US/docs/Mozilla/Firefox/Releases/1.5/Adapting_XUL_Applications_for_Firefox_1.5 /en-US/docs/Mozilla/Firefox/Releases/1.5
/en-US/docs/Mozilla/Firefox/Releases/Firefox_23_for_developers /en-US/docs/Mozilla/Firefox/Releases/23
/en-US/docs/Mozilla/Firefox/Releases/Firefox_41_for_developers /en-US/docs/Mozilla/Firefox/Releases/41
/en-US/docs/Mozilla/Firefox/Releases/Firefox_47_for_developers /en-US/docs/Mozilla/Firefox/Releases/47
Expand Down Expand Up @@ -12245,6 +12246,7 @@
/en-US/docs/Web/HTML/Elements/textarea /en-US/docs/Web/HTML/Element/textarea
/en-US/docs/Web/HTML/Focus_management_in_HTML /en-US/docs/Web/API/Document/hasFocus
/en-US/docs/Web/HTML/Forms_in_HTML /en-US/docs/Learn/Forms
/en-US/docs/Web/HTML/Global_attributes/contextmenu /en-US/docs/Web/HTML/Element/menu
/en-US/docs/Web/HTML/Index /en-US/docs/Web/HTML
/en-US/docs/Web/HTML/Inline_elemente /en-US/docs/Glossary/Inline-level_content
/en-US/docs/Web/HTML/Inline_elements /en-US/docs/Glossary/Inline-level_content
Expand Down
39 changes: 0 additions & 39 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -16581,27 +16581,6 @@
"Roc"
]
},
"Mozilla/Firefox/Releases/1.5/Adapting_XUL_Applications_for_Firefox_1.5": {
"modified": "2019-03-24T00:04:18.819Z",
"contributors": [
"wbamberg",
"SphinxKnight",
"teoli",
"fscholz",
"mrolappe",
"Bedi",
"Mgjbot",
"Indigo",
"NickolayBot",
"Nickolay",
"Matmota",
"Chbok",
"Jesse",
"Dria",
"DarinFisher",
"cbiesinger"
]
},
"Mozilla/Firefox/Releases/1.5/Changing_the_priority_of_HTTP_requests": {
"modified": "2019-03-24T00:05:36.282Z",
"contributors": [
Expand Down Expand Up @@ -98310,24 +98289,6 @@
"teoli"
]
},
"Web/HTML/Global_attributes/contextmenu": {
"modified": "2020-10-15T21:31:57.783Z",
"contributors": [
"alattalatta",
"sideshowbarker",
"mfuji09",
"SphinxKnight",
"ExE-Boss",
"rimunroe",
"chrisdavidmills",
"kbrosnan",
"Jamie0",
"Sebastianz",
"ddurst",
"teoli",
"Kikketer"
]
},
"Web/HTML/Global_attributes/data-*": {
"modified": "2020-10-15T21:31:58.132Z",
"contributors": [
Expand Down
101 changes: 101 additions & 0 deletions files/en-us/glossary/color_space/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
title: Color space
slug: Glossary/Color_space
page-type: glossary-definition
---

{{GlossarySidebar}}

**Color spaces** are named organizations of colors for underlying color models of coordinate-based color arrangements. A color model defines how the components of a color (for example, the `h`, `w`, and `b` channels of an [`hwb()`](/en-US/docs/Web/CSS/color_value/hwb) color) relate to a color space. Color spaces are three-dimensional grids that represent colors. Each dimension (or axis) corresponds to a different channel. Colors can be expressed in multiple color spaces, or transformed from one color space to another, while still looking the same.

Color spaces categorize and define specific ranges of colors. Each color space is defined by a mathematical model and associated rule set. Each color space has a defined [gamut](/en-US/docs/Glossary/Gamut), which refers to the specific range of colors it can represent. These rules enable consistent and reproducible color representation across different devices and software.

The _sRGB_ color space (standard red, green, and blue) was created for the web, but we are no longer limited to this color space. [CSS Color Module Level 4](https://drafts.csswg.org/css-color) specifies several predefined color spaces, and [CSS Color Module Level 5](https://drafts.csswg.org/css-color-5/) goes further, specifying features for defining custom color spaces.

## Named color spaces

The predefined sRGB color spaces include `srgb`, `srgb-linear`, `display-p3`, `a98-rgb`, `prophoto-rgb`, and `rec2020`. The predefined XYZ color spaces include `xyz-d50`, and `xyz-d65` (and `xyz`, an alias for `xyz-d65`).

Color spaces are either [rectangular or polar](https://ericportis.com/posts/2024/okay-color-spaces/). Rectangular color spaces include `srgb`, `srgb-linear`, `display-p3`, `a98-rgb`, `prophoto-rgb`, `rec2020`, `lab`, `oklab`, `xyz-d50`, and `xyz-d65` (or `xyz`). The polar color spaces include `hsl`, `hwb`, `lch`, and `oklch`.

### `sRGB` color spaces

RGB is a color model that represents colors as mixtures of three underlying components — red, green, and blue color channels — that create various hues when combined. sRGB, or "Standard RGB", is the underlying color space for {{Glossary("RGB")}} colors. sRGB is intended as a common color space for the creation of images for viewing on the Internet and World Wide Web (WWW). sRGB is primarily used for displaying colors on computer screens, including laptops and smartphones.

There are several RGB color spaces, like the _Adobe RGB_ color space, that can represent a wider {{glossary("gamut")}} of color than the _sRGB_ color space. The coordinates in _sRGB_ and _Adobe RGB_ (`a98-rgb`) are different. There are many ways to describe the RGB components of a color. In {{Glossary("CSS")}} they can be represented as a single 24-bit integer in hexadecimal notation (for example, `#add8e6` is light blue), or in [`rgb()`](/en-US/docs/Web/CSS/color_value/rgb) functional notation as three separate numbers between 0 and 255 (for example, `rgb(46 139.5 87)`).

CSS `<color>` values in the sRGB color spaces include {{cssxref("hex-color")}}, {{cssxref("named-color")}}, {{cssxref("color_value/rgb", "rgb()")}}, {{cssxref("color_value/hsl", "hsl()")}} (hue, saturation, lightness), and {{cssxref("color_value/hwb", "hwb()")}} (hue, whiteness, blackness). There are also the `srgb`, `srgb-linear`, `a98-rgb`, and `prophoto-rgb` color spaces for the [`color()`](/en-US/docs/Web/CSS/color_value/color) function.

The HSV (hue, saturation, and value) color space, and its synonym HSB (hue, saturation, and brightness), are represented in CSS as [`hwb()`](/en-US/docs/Web/CSS/color_value/hwb). Named colors are simply keywords mapped to specific hex values. Converting these various color notations to sRGB is straightforward mathematically. Note that {{cssxref("&lt;color&gt;","currentcolor","#currentcolor_keyword")}} can be any color, it is not restricted to sRGB.

RGB is not the only color model that can represent the _sRGB_ color space. Cylindrical coordinate systems like the [`HSL`](/en-US/docs/Web/CSS/color_value/hsl) (_hue-saturation-lightness_) or [`HWB`](/en-US/docs/Web/CSS/color_value/hwb) (_hue-whiteness-blackness_) color models are also used to represent a sRGB color on the web.

- `srgb` color space

- : The sRGB color space, or "Standard RGB", is the standard RGB (red, green, blue) color space. It was created to be used on monitors, printers, and the Web. It is the most widely used color space and is supported by most operating systems, software programs, monitors, and printers. sRGB is based on `r`, `g`, and `b`, with in-gamut values ranging from `0` to `1`. The whitepoint is D65.

- `srgb-linear` color space

- : The predefined linear-light sRGB color space, `srgb-linear`, is the same as `srgb` except that the transfer function is linear-light with no gamma-encoding. The `srgb-linear` color space accepts the three `r`, `g`, and `b` values as numeric parameters, with in-gamut colors ranging from `0` to `1`. The whitepoint is D65.

- `display-p3` color space

- : Defined by Apple, the **Display P3** color space combines the DCI-P3 color gamut, the D65 whitepoint, and sRGB gamma curve. It is a wide gamut space typical of current wide-gamut monitors, enabling more vibrant greens and reds than the sRGB color gamut. The `display-p3` is based on `r`, `g`, and `b`, with in-gamut values ranging from `0` to `1`. The whitepoint is D65.

- `a98-rgb` color space

- : `a98-rgb` is the Adobe® 1998 RGB color space designed to represent all the CMYK colors as RGB. About 50% of the visible colors specified by the CIELab color space can be achieved, encompassing more cyan-green hues than other RGB color spaces. In-gamut `r`, `g`, and `b` values range from `0` to `1`. The transfer curve is a gamma function, close to but not exactly 1/2.2. The whitepoint is D65.

- `prophoto-rgb`

- : Developed by Kodak, the `prophoto-rgb` color space can represent all the colors likely to occur in nature and about 90% of CIElab colors. In-gamut `r`, `g`, and `b` values range from `0` to `1`. The transfer curve is a gamma function, with a value of 1/1.8, and a small linear portion near black. The whitepoint is D50, the same one used by CIE Lab.

- `rec2020`

- : `rec2020` is a broadcast industry standard for ultra-high definition 4k and 8k televisions. The ultra-wide gamut space is capable of representing almost all visible real-world colors, beyond the capabilities of most current displays. Coverage is expected to increase over time as displays improve. In-gamut `r`, `g`, and `b` values range from `0` to `1`. The whitepoint is D65.

> **Note:** Additional cylindrical sRGB spaces that are not in the CSS specification include: `HSI` (hue, saturation, and intensity), `Okhsv`, `Okhsl`, `HSLuv`, `HPLuv`, and `Cubehelix`.
### CIELAB color spaces

The CIELAB color space, also referred to as L*a*b*, represents the entire range of color that humans can see. It expresses color as three values: L* for perceptual lightness and a* and b* for the four unique colors of human vision: red, green, blue, and yellow.

Lab is a rectangular coordinate system, with a central lightness `L` axis. Positive values along the `a` axis are a purplish red while negative values are the complement: green. Positive values along the `b` axis are yellow and negative are blue/violet. Desaturated colors have small values for `a` and `b` with greater absolute values being more saturated.

CIELab color functions include {{CSSXref("color_value/lab", "lab()")}} (lightness, a-axis, b-axis) and {{CSSXref("color_value/lch", "lch()")}} (lightness, chroma, hue) as well as {{CSSXref("color_value/oklab", "oklab()")}} and {{CSSXref("color_value/oklch", "oklch()")}}. The lightness values are the same, but `lch()` is a polar, cylindrical coordinate system using polar coordinates `C` (chroma) and `H` (hue) rather than axes. Note the hue and lightness here are different from the same-named values in `hsl()` or other sRGB color spaces.

CIE Lab color spaces, including LCH, Oklab, and Oklch, are device-independent color spaces.

- `lab-d50` color space

- : Expresses color as `L` in a range from `0` to `100`, and `a` and `b` with a range from `-125` to `125`. The `a` and `b` axes are not bound by these range values, which are references in defining percentage inputs and outputs in relation to the `Display P3` color space. The whitepoint is D50.

- `lab-d65` color space

- : This color space is the same as `lab-d50`, except that the whitepoint is D65.

- `oklab` color space

- : Similar to `lab-d65`, but the range for `L` is `0` to `1`, and `a` and `b` range from `-0.4` to `0.4`.

### XYZ color spaces

While combinations of red, green, and blue work well for representing colors on screen, sRGB doesn't directly correspond to how humans perceive color. Created by the International Commission on Illumination (CIE) in 1931, the XYZ color spaces are the first defined quantitative links between distributions of wavelengths in the electromagnetic visible spectrum and perceived colors in human vision.

People with normal vision have three kinds of cone cells that sense light, having peaks of spectral sensitivity in differing wavelengths. The CIE X, Y, and Z parameters correspond to levels of stimuli of the three kinds of cone cells which, in principle, describe every color. The CIE XYZ color space, with its tri-stimulus values, encompasses all visible colors.

- `xyz` and `xyz-d65` color space

- : The `xyz` identifier is a synonym for the `xyz-d65` color space. The axes are not limited to a `0` to `1` range as the color space is not bound to this range; these values are only used as reference points in defining percentage inputs and outputs. The whitepoint is D65.

- `xyz-d50` color space

- : `xyz-d50` is the same as `xyz-d65` except it uses `d50` as the whitepoint.

## See also

- {{cssxref("@media/color-gamut", "color-gamut")}} `@media` feature
- [CSS data type: `<color>`](/en-US/docs/Web/CSS/color_value)
- [sRGB color space](https://webstore.iec.ch/publication/6168)
- [CIELAB](https://en.wikipedia.org/wiki/CIELAB_color_space) color space
- [Oklab](https://bottosson.github.io/posts/oklab/) color space
14 changes: 7 additions & 7 deletions files/en-us/glossary/rgb/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ page-type: glossary-definition

_Red-Green-Blue_ (**RGB**) is a color model that represents colors as mixtures of three underlying components (or channels), namely: _red_, _green_, and _blue_. This model describes a color with a sequence of three numbers (typically between 0.0 and 1.0, or between 0 and 255). Each number represents the primary colors' different intensities (or contributions) in determining the final color.

Alone an RGB value has no meaning. A color model defines how the three components relate to a color space. Graphically, a point in a three-dimensional grid or cube represents a color. Each dimension (or axis) corresponds to a different channel. The RGB color model is then a _cubic_, or _Cartesian_, coordinate system of the underlying color space.
An RGB value by itself has no meaning. It's the color model that defines how the three components interact within a {{glossary("color space")}} to define a color. Graphically, a point in a three-dimensional grid or cube represents a color. Each dimension (or axis) corresponds to a different channel. The RGB color model is then a _cubic_, or _Cartesian_, coordinate system of the underlying color space.

For the web, the underlying color space for an RGB value is _sRGB_ (Standard RGB), and each RGB component is a number between 0 and 255.

Note that there are other RGB color spaces, like the _Adobe RGB_ color space, that can represent a wider {{glossary("gamut")}} of color than the _sRGB_ color space. The coordinates in _sRGB_ and _Adobe RGB_ are different.

There are many ways to describe the RGB components of a color. In {{Glossary("CSS")}} they can be represented as a single 24-bit integer in hexadecimal notation (for example, `#add8e6` is light blue), or in functional notation, [`rgb()`](/en-US/docs/Web/CSS/color_value/rgb) as three separate numbers between 0 and 255 (for example, `rgb(46 139.5 87)`). There are also the `srgb`, `srgb-linear`, `a98-rgb`, and `prophoto-rgb` color spaces for the [`color()`](/en-US/docs/Web/CSS/color_value/color) function.
There are many ways to describe the RGB components of a color. In {{Glossary("CSS")}}, they can be represented in various ways: in [hexadecimal](/en-US/docs/Web/CSS/hex-color) notation as a single 24-bit integer (for example, `#add8e6` is light blue) or in functional notation by using [`rgb()`](/en-US/docs/Web/CSS/color_value/rgb) with three numbers ranging from `0` to `255` (for example, `rgb(46 139 87)` is green). CSS also supports the `srgb`, `srgb-linear`, `a98-rgb`, and `prophoto-rgb` color spaces for the [`color()`](/en-US/docs/Web/CSS/color_value/color) function.

RGB is not the only color model that can represent the _sRGB_ color space. Cylindrical coordinate systems like the [`HSL`](/en-US/docs/Web/CSS/color_value/hsl) (_hue-saturation-lightness_) or [`HWB`](/en-US/docs/Web/CSS/color_value/hwb) (_hue-whiteness-blackness_) color models are also used to represent a sRGB color on the web.
RGB is not the only color model that can represent the `sRGB` {{glossary("color space")}}. Cylindrical coordinate systems like the [`HSL`](/en-US/docs/Web/CSS/color_value/hsl) (_hue-saturation-lightness_) or [`HWB`](/en-US/docs/Web/CSS/color_value/hwb) (_hue-whiteness-blackness_) color models are also used to represent an `sRGB` color on the web.

## See also

- [RGB color model on Wikipedia](https://en.wikipedia.org/wiki/RGB_color_model)
- [sRGB color space on Wikipedia](https://en.wikipedia.org/wiki/SRGB)
- [Adobe RGB color space on Wikipedia](https://en.wikipedia.org/wiki/Adobe_RGB_color_space)
- [CSS data type: \<color>](/en-US/docs/Web/CSS/color_value)
- [CSS data type: `<color>`](/en-US/docs/Web/CSS/color_value)
- [RGB color model](https://en.wikipedia.org/wiki/RGB_color_model) on Wikipedia
- [sRGB color space](https://en.wikipedia.org/wiki/SRGB) on Wikipedia
- [Adobe RGB color space](https://en.wikipedia.org/wiki/Adobe_RGB_color_space) on Wikipedia
2 changes: 1 addition & 1 deletion files/en-us/learn/css/first_steps/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: CSS first steps overview
title: CSS first steps
slug: Learn/CSS/First_steps
page-type: learn-module
---
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/learn/forms/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Web forms — Working with user data
title: Web form building blocks
slug: Learn/Forms
page-type: learn-module
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ There are many other elements in HTML for formatting text, which we didn't get t

## Description lists

In HTML text fundamentals, we walked through how to [mark up basic lists](/en-US/docs/Learn/HTML/Introduction_to_HTML/HTML_text_fundamentals#lists) in HTML, but we didn't mention the third type of list you'll occasionally come across — **description lists**. The purpose of these lists is to mark up a set of items and their associated descriptions, such as terms and definitions, or questions and answers. Let's look at an example of a set of terms and definitions:
In HTML text fundamentals, we walked through how to [mark up basic lists](/en-US/docs/Learn/HTML/Introduction_to_HTML/HTML_text_fundamentals#lists) in HTML, and we mentioned the third type of list you'll occasionally come across — **description lists**. The purpose of these lists is to mark up a set of items and their associated descriptions, such as terms and definitions, or questions and answers. Let's look at an example of a set of terms and definitions:

```plain
soliloquy
Expand Down
Loading

0 comments on commit 0115d62

Please sign in to comment.