

RGBColor
Details


- RGBColor is a color representation using three additive colors (red, green and blue), typically used as color specification for fonts, graphics primitives, image pixels and more.
- RGB is commonly used by display devices such as screens and projectors. The actual color displayed may vary from device to device, depending on the type and response of their color elements to the {r,g,b} values.
- Red, green, and blue color intensities outside the range 0 to 1 will be clipped, as will opacities. »
- If no opacity has been specified, RGBColor[r,g,b] is equivalent to RGBColor[r,g,b,1].
- RGBColor[r,g,b,a] is equivalent to {RGBColor[r,g,b],Opacity[a]}.
- The alternative forms RGBColor[{r,g,b}] and RGBColor[{r,g,b,a}] can also be used. »
- In RGBColor[spec], spec can be any of the following:
-
"#rrggbb" six-digit hexadecimal "#rgb" three-digit (shorthand) hexadecimal form "#rrggbbaa" hexadecimal form with opacity "htmlcolor" HTML color color convert from any ColorQ expression - ColorConvert can be used to convert to and from other color spaces such as XYZ and HSB.
- The following wrappers can be used around colors:
-
ColorsNear[color,…] specifies a region around color Directive[…,color,…] specifies a color in combination with other directives Glow[color] specifies color independent of lighting » Opacity[a,color] specifies a color with an opacity a Style[expr,color] displays expr with the specified color » - For 3D surfaces, explicit RGBColor directives define surface colors; the final shading depends on lighting and contributions from specularity and glow. »

Examples
open all close allBasic Examples (4)
Scope (6)
Color Specification (3)
Colors in 3D (1)
Generalizations & Extensions (2)
Properties & Relations (3)
Use ColorData for named color gradients:
Use ColorData for named color schemes:
Use ColorSetter to get a simple color selector (click the color rectangle):
Or use ColorSlider to directly select colors:
Possible Issues (1)
Values outside of the 0, 1 range will be clipped:
In plot functions, use ColorFunctionScaling to control global scaling of variables:
See Also
Hue GrayLevel CMYKColor LABColor LCHColor LUVColor XYZColor ThemeColor Opacity Blend Lighter Darker Glow Specularity Lighting Raster Red Green Blue White ColorSlider ColorConvert ColorDistance ConstantImage
Function Repository: RYBColor ColorSearch NearestColorName
Tech Notes
History
Introduced in 1988 (1.0) | Updated in 2007 (6.0) ▪ 2008 (7.0) ▪ 2014 (10.0) ▪ 2015 (10.1) ▪ 2021 (12.3)
Text
Wolfram Research (1988), RGBColor, Wolfram Language function, https://reference.wolfram.com/language/ref/RGBColor.html (updated 2021).
CMS
Wolfram Language. 1988. "RGBColor." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/RGBColor.html.
APA
Wolfram Language. (1988). RGBColor. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RGBColor.html
BibTeX
@misc{reference.wolfram_2025_rgbcolor, author="Wolfram Research", title="{RGBColor}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/RGBColor.html}", note=[Accessed: 09-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_rgbcolor, organization={Wolfram Research}, title={RGBColor}, year={2021}, url={https://reference.wolfram.com/language/ref/RGBColor.html}, note=[Accessed: 09-August-2025]}