Rgb() function
The CSS rgb() function specifies a color using red, green, and blue component values in the sRGB color space.
CSS in Depth, Second Edition
The CSS rgb() color function specifies a color using red, green, and blue components in the sRGB color space.
- How it is used
- Specifies CSS colors using decimal red, green, and blue components.
- How deep it goes
- Defines component ranges and hex equivalence, but stops short of a broader `rgb()` syntax reference.
- Examples
- Compares `rgb(0 0 0)` with `#000` and `rgb(136 0 0)` with `#800`.
- What you can do after
- Evaluate/understand equivalent RGB and hex values when choosing a CSS color notation.
Read how CSS in Depth, Second Edition explains rgb() function →
Web Design Playground
A CSS color function that specifies a color by combining red, green, and blue component values.
- How it is used
- Supplies CSS color values for text and backgrounds, and serves as an input or output in color-selection tools.
- How deep it goes
- Explains three 0–255 components, percentage equivalents, a CSS rule, and defers transparency to rgba().
- Examples
- Uses a purple h1 rule, percentage purple notation, common-color component combinations, and red and light-gray practice prompts.
- What you can do after
- Apply it through CSS color properties to assign decimal or percentage RGB colors to elements.
Math for Web Design
rgb() is a CSS color function that specifies a color using red, green, and blue component values.
- How it is used
- Specifies CSS colors for fixed styles or dynamically generated JavaScript values.
- How deep it goes
- Defines channel ranges, additive color mixing, percentages, alpha, and hexadecimal alternatives without developing color conversion.
- Examples
- Uses black, white, grayscale, purple CSS text, translucent purple, and a JavaScript random-color generator.
- What you can do after
- Apply it via CSS or JavaScript to specify colors, transparency, and randomly generated channel values.
Related concepts
- hexadecimal color notationalternative to · Hexadecimal color notation is a textual representation of color components using hexadecimal digits, typically encoding red, green, blue, and optionally alpha.
- HSL methodalternative to · The HSL method represents colors using hue, saturation, and lightness within a color model or notation system.
- RGBuses · RGB is an additive color model that represents colors through separate red, green, and blue component values or intensities.
- coloruses · Color is a visual property or representation characterized by attributes such as hue, lightness, saturation, or component values.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


