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

# Online Help

###### All Products    Maple    MapleSim

ColorTools

 GetPaletteColors
 return all the colors in a palette

 Calling Sequence GetPaletteColors(N)

Parameters

 N - string used to identify the palette, possibly with modifiers

Description

 • The GetPaletteColors command returns a list of the colors in a Palette object associated with the name N (a string that is not case-sensitive).
 • The name of the palette can be prefixed with modifiers to change the order in which the colors are returned
 – "reverse PaletteName" returns the colors in reverse order
 – "shifted PaletteName" returns the colors shifted by 50%
 – "reverse shifted PaletteName" first shifts and then reverses
 – "shifted reverse PaletteName" first reverses and then shifts
 – "shifted[n]" shifts exactly $n\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{nops}\left(N\right)$ steps to the left if n is an integer
 – "shifted[f]" shifts to the left by $100f$% if f is a floating point number

Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $\mathrm{GetPaletteColors}\left("dalton"\right)$
 $\left[{⟨}\colorbox[rgb]{0.337254901960784,0.705882352941177,0.913725490196078}{RGB : Sky Blue}{⟩}{,}{⟨}\colorbox[rgb]{0.835294117647059,0.368627450980392,0}{RGB : Vermillion}{⟩}{,}{⟨}\colorbox[rgb]{0.941176470588235,0.894117647058824,0.258823529411765}{RGB : Yellow}{⟩}{,}{⟨}\colorbox[rgb]{0,0.447058823529412,0.698039215686274}{{RGB : Blue}}{⟩}{,}{⟨}\colorbox[rgb]{0.901960784313726,0.623529411764706,0}{RGB : Orange}{⟩}{,}{⟨}\colorbox[rgb]{0.8,0.474509803921569,0.654901960784314}{RGB : Reddish Purple}{⟩}{,}{⟨}\colorbox[rgb]{0,0.619607843137255,0.450980392156863}{RGB : Bluish Green}{⟩}{,}{⟨}\colorbox[rgb]{0.980392156862745,0.901960784313726,0.745098039215686}{RGB : Pale Orange}{⟩}{,}{⟨}\colorbox[rgb]{0.509803921568627,0.0784313725490196,0.627450980392157}{{RGB : Purple}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,0}{{RGB : Black}}{⟩}\right]$ (1)
 > $P≔\mathrm{Palette}\left(\left["Red"=\mathrm{Color}\left("#f00"\right),"Blue"=\mathrm{Color}\left("#00f"\right),"Green"=\mathrm{Color}\left("#0f0"\right)\right]\right)$
 ${P}{≔}⟨{Palette:}{}\colorbox[rgb]{1,0,0}{{Red}}{}\colorbox[rgb]{0,0,1}{{Blue}}{}\colorbox[rgb]{0,1,0}{Green}⟩$ (2)
 > $\mathrm{AddPalette}\left("Primary",P\right)$
 $\left[{"bright"}{,}{"dalton"}{,}{"executive"}{,}{"mono"}{,}{"nautical"}{,}{"niagara"}{,}{"oldplots"}{,}{"patchwork"}{,}{"spring"}{,}{"css"}{,}{"cvd"}{,}{"cvd2"}{,}{"cvd3"}{,}{"html"}{,}{"maplev"}{,}{"x11"}{,}{"resene"}{,}{"generic"}{,}{"xterm"}{,}{"solarized"}{,}{"xkcd"}{,}{"beersrm"}{,}{"inferno"}{,}{"magma"}{,}{"plasma"}{,}{"viridis"}{,}{"cividis"}{,}{"turbo"}{,}{"twilight"}{,}{"colorwheel"}{,}{"coolwarm"}{,}{"divergebjy"}{,}{"divergebkr"}{,}{"divergebky"}{,}{"divergebwy"}{,}{"divergegwv"}{,}{"divergerainbow"}{,}{"isocircle"}{,}{"isoluminant"}{,}{"rainbow"}{,}{"primary"}\right]$ (3)
 > $\mathrm{GetPaletteColors}\left("primary"\right)$
 $\left[{⟨}\colorbox[rgb]{1,0,0}{{RGB : Red}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,1}{{RGB : Blue}}{⟩}{,}{⟨}\colorbox[rgb]{0,1,0}{RGB : Green}{⟩}\right]$ (4)
 > $\mathrm{GetPaletteColors}\left("reverse primary"\right)$
 $\left[{⟨}\colorbox[rgb]{0,1,0}{RGB : Green}{⟩}{,}{⟨}\colorbox[rgb]{0,0,1}{{RGB : Blue}}{⟩}{,}{⟨}\colorbox[rgb]{1,0,0}{{RGB : Red}}{⟩}\right]$ (5)
 > $\mathrm{GetPaletteColors}\left("shifted\left[1\right] primary"\right)$
 $\left[{⟨}\colorbox[rgb]{1,0,0}{{RGB : Red}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,1}{{RGB : Blue}}{⟩}{,}{⟨}\colorbox[rgb]{0,1,0}{RGB : Green}{⟩}\right]$ (6)
 > $\mathrm{GetPaletteColors}\left("shifted\left[0.75\right] primary"\right)$
 $\left[{⟨}\colorbox[rgb]{0,1,0}{RGB : Green}{⟩}{,}{⟨}\colorbox[rgb]{1,0,0}{{RGB : Red}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,1}{{RGB : Blue}}{⟩}\right]$ (7)
 > $\mathrm{GetPaletteColors}\left("shifted reverse css"\right)$
 $\left[{⟨}\colorbox[rgb]{0,1,1}{RGB : Aqua}{⟩}{,}{⟨}\colorbox[rgb]{0,0.501960784313725,0.501960784313725}{{RGB : Teal}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,1}{{RGB : Blue}}{⟩}{,}{⟨}\colorbox[rgb]{0,0,0.501960784313725}{{RGB : Navy}}{⟩}{,}{⟨}\colorbox[rgb]{1,0,1}{RGB : Fuchsia}{⟩}{,}{⟨}\colorbox[rgb]{0.501960784313725,0,0.501960784313725}{{RGB : Purple}}{⟩}{,}{⟨}\colorbox[rgb]{0.501960784313725,0.501960784313725,0.501960784313725}{RGB : Gray}{⟩}{,}{⟨}\colorbox[rgb]{0.749019607843137,0.749019607843137,0.749019607843137}{RGB : Silver}{⟩}{,}{⟨}RGB : White{⟩}{,}{⟨}\colorbox[rgb]{0,0,0}{{RGB : Black}}{⟩}{,}{⟨}\colorbox[rgb]{1,0,0}{{RGB : Red}}{⟩}{,}{⟨}\colorbox[rgb]{0.501960784313725,0,0}{{RGB : Maroon}}{⟩}{,}{⟨}\colorbox[rgb]{1,0.650980392156863,0}{RGB : Orange}{⟩}{,}{⟨}\colorbox[rgb]{1,1,0}{RGB : Yellow}{⟩}{,}{⟨}\colorbox[rgb]{0.501960784313725,0.501960784313725,0}{RGB : Olive}{⟩}{,}{⟨}\colorbox[rgb]{0,1,0}{RGB : Lime}{⟩}{,}{⟨}\colorbox[rgb]{0,0.501960784313725,0}{{RGB : Green}}{⟩}\right]$ (8)

Compatibility

 • The ColorTools[GetPaletteColors] command was introduced in Maple 2023.
 • For more information on Maple 2023 changes, see Updates in Maple 2023.

 See Also