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 >

Blend

Blend[{col1, col2}, x]
gives a color obtained by blending a fraction 1-x of color col1 and x of color col2.
Blend[{col1, col2, col3, ...}, x]
linearly interpolates between colors coli as x varies from 0 to 1.
Blend[{{x1, col1}, {x2, col2}, ...}, x]
interpolates to give coli when x=xi.
Blend[{col1, col2, ...}, {u1, u2, ...}]
blends all the coli, using fraction ui of color coli.
Blend[{col1, col2, ...}]
blends equal fractions of all the coli.
  • In Blend[{col1, ..., coln}, {u1, ..., un}] the ui are normalized to have total 1.  »
  • Blend implements additive color mixing, as appropriate for color light sources or light-generating displays.
Blend two colors by fractions:
Generate an array of blended colors ranging from red to blue:
Represent the height as a blend from yellow to purple:
Average two colors equally:
Blend two colors by fractions:
In[1]:=
Click for copyable input
Out[1]=
 
Generate an array of blended colors ranging from red to blue:
In[1]:=
Click for copyable input
Out[1]=
 
Represent the height as a blend from yellow to purple:
In[1]:=
Click for copyable input
Out[1]=
 
Average two colors equally:
In[1]:=
Click for copyable input
Out[1]=
Linear interpolation between two colors:
Linear interpolation between two colors and two opacities:
Linear interpolation between multiple colors uniformly:
Linear interpolation between colors at specific values:
Blending colors with equal weights:
Blending colors with specified weights:
Different colors can be given at the single position to generate discontinuity:
Use Blend to construct a ColorFunction from base colors:
The weights are always normalized, so that the sum becomes 1:
The position values are always sorted:
When colors are specified using the same color space, that space is used for interpolation:
When colors are specified using different color spaces, interpolation happens in the RGB space:
Lighter is a special case of Blend:
Darker is a special case of Blend:
ColorData contains a large number of predefined Blend colors called "Gradients":
Gradients can be called by their names only:
Polygon supports equal weight blending of VertexColors:
Values outside of the 0, 1 range will be clipped:
In plot functions, use ColorFunctionScaling to control global scaling of variables:
Use Blend with plots to generate synthesized textures:
Simulated colors of stars:
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team