Skip to content

Commit

Permalink
Adapt rgb glossary entry with info about sRGB (#14890)
Browse files Browse the repository at this point in the history
* Adapt rgb glossary entry with info about sRGB

* Cut sentence in two.

Co-authored-by: wbamberg <will@bootbonnet.ca>

* Use colon to introduce a list

Co-authored-by: wbamberg <will@bootbonnet.ca>

Co-authored-by: wbamberg <will@bootbonnet.ca>
  • Loading branch information
teoli2003 and wbamberg authored Apr 12, 2022
1 parent cc18f43 commit 0654603
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions files/en-us/glossary/rgb/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ tags:
- Design
- Guide
---
Red Green Blue (RGB) is a color model that represents colors as mixtures of three underlying components (or channels), namely, red, green, and blue. Each color is described by a sequence of three numbers (typically between 0.0 and 1.0, or between 0 and 255) that represent the different intensities (or contributions) of red, green, and blue, in determining the final color.
_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.

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 as three separate 8-bit integers (for example, rgb(46, 139, 87) is sea green). In {{Glossary("OpenGL")}}, {{Glossary("WebGL")}}, and {{Glossary("GLSL")}} the red-green-blue components are fractions (floating-point numbers between 0.0 and 1.0), although in the actual color buffer they are typically stored as 8-bit integers. Graphically, a color can be represented as a point in a three-dimensional grid or cube, where each dimension (or axis) corresponds to a different channel.
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.

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. Float values are supported.

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 floats between 0 and 255 (for example, `rgb(46 139.5 87)`). In {{Glossary("OpenGL")}}, {{Glossary("WebGL")}}, and {{Glossary("GLSL")}} the red-green-blue components are fractions (floating-point numbers between 0.0 and 1.0), although in the actual color buffer they are typically stored as 8-bit integers.

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.

## 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)

0 comments on commit 0654603

Please sign in to comment.