ColorTools

 generate a selection of intermediate colors

Parameters

 color1,color2 - colors in formats recognized by ColorTools

Options

 • number=nonnegint
 the number of intermediate colors to compute (default is 10)
 • space=string
 the color space in which to compute the intermediate colors. By default this is inferred from the colors spaces of the input.
 • best
 if this keyword is given, a heuristic is used to get a well-spaced set of colors
 • displayable
 if this keyword is given, then each output color will be displayable

Description

 • The Gradient command computes a number of intermediate colors that transition between the two colors in the input range.

Examples

 > with(ColorTools):
 ${G}{≔}\left[{⟨}\colorbox[rgb]{1,0,0}{{RGB : 1 0 0}}{⟩}{,}{⟨}\colorbox[rgb]{0.909803921568627,0,0.0901960784313725}{{RGB : 0.909 0 0.0909}}{⟩}{,}{⟨}\colorbox[rgb]{0.819607843137255,0,0.180392156862745}{{RGB : 0.818 0 0.182}}{⟩}{,}{⟨}\colorbox[rgb]{0.725490196078431,0,0.274509803921569}{{RGB : 0.727 0 0.273}}{⟩}{,}{⟨}\colorbox[rgb]{0.635294117647059,0,0.364705882352941}{{RGB : 0.636 0 0.364}}{⟩}{,}{⟨}\colorbox[rgb]{0.545098039215686,0,0.454901960784314}{{RGB : 0.545 0 0.455}}{⟩}{,}{⟨}\colorbox[rgb]{0.454901960784314,0,0.545098039215686}{{RGB : 0.455 0 0.545}}{⟩}{,}{⟨}\colorbox[rgb]{0.364705882352941,0,0.635294117647059}{{RGB : 0.364 0 0.636}}{⟩}{,}{⟨}\colorbox[rgb]{0.274509803921569,0,0.725490196078431}{{RGB : 0.273 0 0.727}}{⟩}{,}{⟨}\colorbox[rgb]{0.180392156862745,0,0.819607843137255}{{RGB : 0.182 0 0.818}}{⟩}{,}{⟨}\colorbox[rgb]{0.0901960784313725,0,0.909803921568627}{{RGB : 0.0909 0 0.909}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,1}{{RGB : 0 0 1}}{⟩}\right]$ (1)
 ${H}{≔}\left[{⟨}\colorbox[rgb]{1,0,0}{{RGB : 1 0 0}}{⟩}{,}{⟨}\colorbox[rgb]{0.968627450980392,0,0.176470588235294}{{RGB : 0.967 0 0.176}}{⟩}{,}{⟨}\colorbox[rgb]{0.933333333333333,0,0.270588235294118}{{RGB : 0.933 0 0.27}}{⟩}{,}{⟨}\colorbox[rgb]{0.898039215686275,0,0.352941176470588}{{RGB : 0.896 0 0.351}}{⟩}{,}{⟨}\colorbox[rgb]{0.854901960784314,0,0.427450980392157}{{RGB : 0.857 0 0.429}}{⟩}{,}{⟨}\colorbox[rgb]{0.811764705882353,0,0.505882352941176}{{RGB : 0.813 0 0.505}}{⟩}{,}{⟨}\colorbox[rgb]{0.76078431372549,0,0.584313725490196}{{RGB : 0.762 0 0.583}}{⟩}{,}{⟨}\colorbox[rgb]{0.701960784313725,0,0.662745098039216}{{RGB : 0.703 0 0.661}}{⟩}{,}{⟨}\colorbox[rgb]{0.631372549019608,0,0.741176470588235}{{RGB : 0.63 0 0.742}}{⟩}{,}{⟨}\colorbox[rgb]{0.537254901960784,0,0.823529411764706}{{RGB : 0.536 0 0.825}}{⟩}{,}{⟨}\colorbox[rgb]{0.396078431372549,0,0.909803921568627}{{RGB : 0.397 0 0.911}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,1}{{RGB : 0 0 1}}{⟩}\right]$ (2)