Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Visualization and Graphics > Graphics Options & Styling > Colors >
Mathematica > Data Manipulation > Image Processing & Analysis > Color Processing > Colors >
Mathematica > Visualization and Graphics > Symbolic Graphics Language > Graphics Directives > Colors >

RGBColor

RGBColor[red, green, blue]
is a graphics directive which specifies that objects which follow are to be displayed, if possible, in the color given.
RGBColor[r, g, b, a]
specifies opacity a.
  • Red, green and blue color intensities outside the range 0 to 1 will be clipped, as will opacities.  »
  • On monochrome output devices, a gray level based on the average of the color intensities is used.
  • For 3D surfaces, explicit RGBColor directives define surface colors; the final shading depends on lighting and contributions from specularity and glow.  »
  • Glow[RGBColor[...]] specifies color independent of lighting.  »
  • In RGBColor[r, g, b, a], a is an "alpha channel" used to specify opacity.
  • If no opacity has been specified, RGBColor[r, g, b] is equivalent to RGBColor[r, g, b, 1].
  • Style[expr, RGBColor[...]] specifies that expr should be displayed with the specified color.  »
Specify the color of graphics primitives:
Specify the color with opacity:
Specify the output color of expressions:
Specify the color of plots:
Specify the color of graphics primitives:
In[1]:=
Click for copyable input
Out[1]=
 
Specify the color with opacity:
In[1]:=
Click for copyable input
Out[1]=
 
Specify the output color of expressions:
In[1]:=
Click for copyable input
Out[1]=
 
Specify the color of plots:
In[1]:=
Click for copyable input
Out[1]=
Use diffuse surface color:
Use diffuse and specular surface color:
Use glow color, setting the diffuse surface color to black:
Use Blend to mix two or more colors:
Use Lighter and Darker to mix with white and black, respectively:
RGBColor[{r, g, b}] is equivalent to RGBColor[r, g, b]:
Use Opacity with RGBColor:
Use the opacity argument in RGBColor directly:
Define a one-dimensional color function:
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:
Values outside of the 0, 1 range will be clipped:
In plot functions, use ColorFunctionScaling to control global scaling of variables:
Visualizing the RGB color space:
RGB noise with opacity:
New in 1 | Last modified in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team