Skip to content

ColorData

Named color data. Without arguments it lists the categories:

$ wo 'ColorData[]'
{Gradients, Indexed, Named, Physical}

ColorData[n, k] gives the k-th color of indexed scheme n. Scheme 1 is generated rather than tabulated — its hues advance by an irrational step, so it never repeats and takes any index:

$ wo 'Head[ColorData[1, 1]]'
RGBColor
$ wo 'Round[List @@ ColorData[1, 4], 0.000001]'
{0.24, 0.6, 0.33692}

The tabulated schemes start over past their last color:

$ wo 'List @@ ColorData[2, 1]'
{0.8588235294117647, 0.00784313725490196, 0.00784313725490196}
$ wo 'List @@ ColorData[2, 10]'
{0.8588235294117647, 0.00784313725490196, 0.00784313725490196}

ColorData[n, "ColorList"] gives the scheme's colors:

$ wo 'Length[ColorData[3, "ColorList"]]'
10

ColorData["scheme"] gives a named gradient's color function; applying it (or calling Blend with the scheme name) interpolates the gradient:

$ wo 'Head[ColorData["TemperatureMap"]]'
ColorDataFunction
$ wo 'Blend["TemperatureMap", 0]'
RGBColor[0.178927, 0.305394, 0.933501]

The "HTML" scheme is the CSS colour names:

$ wo 'ColorData["HTML", "SlateBlue"]'
RGBColor[0.4156862745098039, 0.3529411764705882, 0.803921568627451]
$ wo 'ColorData["HTML", "Aqua"]'
RGBColor[0, 1., 1.]

The "Legacy" scheme is the pre-v6 GraphicsColors` palette. Despite the overlapping names it is a different table from"HTML": its channels are stored to six digits rather than as exactn/255`, and it carries artists' pigment names the CSS table has no entry for.

$ wo 'ColorData["Legacy", "Wheat"]'
RGBColor[0.960799, 0.870602, 0.702002]
$ wo 'ColorData["Legacy", "AlizarinCrimson"]'
RGBColor[0.889996, 0.149998, 0.209998]