# Color Blend in Different Color Spaces

The relationship between two colors is deeply influenced by the color model that is used to describe them. The function Blend performs a color mixing in the color's native space, thus preserving its natural metric and its characteristics.

Blend offers unique results depending on the color model.

 In[1]:= XBlend@ColorConvert[{RGBColor[0, 0, 1], RGBColor[1, 1, 0]}, "RGB"]
 Out[1]=
 In[2]:= XBlend@ColorConvert[{RGBColor[0, 0, 1], RGBColor[1, 1, 0]}, "HSB"]
 Out[2]=

Compare blue-to-red blend in RGB and HSB spaces.

 In[3]:= XArrayPlot[{Table[ Blend[ColorConvert[{Blue, Red}, "RGB"], n], {n, 0, 1, .01}]}, AspectRatio -> .25]
 Out[3]=
 In[4]:= XArrayPlot[{Table[ Blend[ColorConvert[{Blue, Red}, "HSB"], n], {n, 0, 1, .01}]}, AspectRatio -> .25]
 Out[4]=

A 3D representation of an RGB blend is a straight line in RGB itself but a curve in a perceptually accurate space like CIE .

 Out[5]=

Blue-to-red blend in four different color spaces.

 In[6]:= XColumn[Labeled[ ArrayPlot[{Table[ Blend[ColorConvert[{Blue, Red}, #], n], {n, 0, 1, .01}]}, AspectRatio -> .25], #] & /@ {RGBColor, Hue, XYZColor, LCHColor}]
 Out[6]=

Use red-to-blue (center to corner) blend in different spaces for coloring plots.

 Out[7]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »