ColorTools

 register a color palette

Parameters

 N - string to be used to identify the palette P - Palette object created with ColorTools[Palette]

Description

 • The AddPalette command registers the palette P with the name N so that it will be usable by all ColorTools commands.  The string N must contain only alphanumeric characters.  It will be stored in lowercase but the capitalization will be preserved.
 • It returns a list of the normalized names of all the known palettes after the addition.

Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $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}⟩$ (1)
 > $\mathrm{AddPalette}\left("Primary",P\right)$
 $\left[{"niagara"}{,}{"nautical"}{,}{"spring"}{,}{"oldplots"}{,}{"mono"}{,}{"dalton"}{,}{"executive"}{,}{"bright"}{,}{"patchwork"}{,}{"css"}{,}{"cvd"}{,}{"cvd2"}{,}{"cvd3"}{,}{"html"}{,}{"maplev"}{,}{"x11"}{,}{"resene"}{,}{"generic"}{,}{"xterm"}{,}{"solarized"}{,}{"xkcd"}{,}{"primary"}\right]$ (2)
 > $\mathrm{NameToRGB24}\left("Primary Green"\right)$
 $\left[{0}{,}{255}{,}{0}\right]$ (3)
 > $\mathrm{NearestNamedColor}\left(\left[0,255,0\right],\mathrm{palette}="Primary"\right)$
 $\left[{"Primary Green"}{,}{0.}\right]$ (4)
 > $\mathrm{RemovePalette}\left("Primary"\right)$
 $\left[{"niagara"}{,}{"nautical"}{,}{"spring"}{,}{"oldplots"}{,}{"mono"}{,}{"dalton"}{,}{"executive"}{,}{"bright"}{,}{"patchwork"}{,}{"css"}{,}{"cvd"}{,}{"cvd2"}{,}{"cvd3"}{,}{"html"}{,}{"maplev"}{,}{"x11"}{,}{"resene"}{,}{"generic"}{,}{"xterm"}{,}{"solarized"}{,}{"xkcd"}\right]$ (5)

Compatibility

 • The ColorTools[AddPalette] command was introduced in Maple 16.