Gradient - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

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 using the Jab perceptual color space.
 • 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 := Gradient("Red".."Blue");
 ${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 := Gradient("Red".."Blue", best);
 ${H}{≔}\left[{⟨}\colorbox[rgb]{1,0,0}{{RGB : 1 0 0}}{⟩}{,}{⟨}\colorbox[rgb]{0.905882352941176,0.2,0.180392156862745}{RGB : 0.905 0.198 0.179}{⟩}{,}{⟨}\colorbox[rgb]{0.811764705882353,0.266666666666667,0.27843137254902}{RGB : 0.813 0.265 0.279}{⟩}{,}{⟨}\colorbox[rgb]{0.72156862745098,0.301960784313725,0.356862745098039}{RGB : 0.722 0.303 0.357}{⟩}{,}{⟨}\colorbox[rgb]{0.635294117647059,0.325490196078431,0.415686274509804}{RGB : 0.635 0.324 0.416}{⟩}{,}{⟨}\colorbox[rgb]{0.552941176470588,0.333333333333333,0.458823529411765}{RGB : 0.552 0.334 0.459}{⟩}{,}{⟨}\colorbox[rgb]{0.47843137254902,0.333333333333333,0.486274509803922}{{RGB : 0.478 0.334 0.487}}{⟩}{,}{⟨}\colorbox[rgb]{0.411764705882353,0.325490196078431,0.517647058823529}{{RGB : 0.412 0.324 0.516}}{⟩}{,}{⟨}\colorbox[rgb]{0.345098039215686,0.305882352941176,0.564705882352941}{{RGB : 0.346 0.306 0.563}}{⟩}{,}{⟨}\colorbox[rgb]{0.266666666666667,0.282352941176471,0.63921568627451}{{RGB : 0.268 0.281 0.641}}{⟩}{,}{⟨}\colorbox[rgb]{0.16078431372549,0.235294117647059,0.768627450980392}{{RGB : 0.161 0.234 0.77}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,1}{{RGB : 0 0 1}}{⟩}\right]$ (2)
 > Swatches([G[], H[]], rows=2);

Compatibility

 • The ColorTools[Gradient] command was introduced in Maple 16.
 • For more information on Maple 16 changes, see Updates in Maple 16.
 • The ColorTools[Gradient] command was updated in Maple 2023.
 • The best option was updated in Maple 2023.