getColorPalette ============================================== Purpose ---------------- Retrieves a named color palette as a string array. Some names offer multiple palettes based on the number of colors requested. These generally range from a base of 3 to a maximum of 8-12 for color brewer palettes. Format ---------------- .. function:: clrs = getColorPalette(name[, ncolors]) :param name: The name of the color palette. The full set of built-in color palettes `can be seen here `_. The list of palettes can be queried with :func:`listColorPalettes`. :type name: string Valid options include: ``*`` denotes colorblind friendly palette .. raw:: html
Spectral
RdYlGn
RdBu*
PiYG*
PRGn*
RdYlBu*
BrBG*
RdGy
PuOr*
Set2*
Accent
Dark2*
Pastel2
Pastel1
Set1
Set3
Paired*
YlOrRd*
OrRd*
PuBu*
BuPu*
Oranges*
BuGn*
YlOrBr*
YlGn*
Reds*
RdPu*
Greens*
YlGnBu*
Purples*
GnBu*
Greys*
PuRd*
Blues*
PuBuGn*
viridis
magma
inferno
plasma
* denotes colorblind friendly palette :param ncolors: Optional. The desired number of colors for a specific palette. Default value is 6. If *ncolors* is fewer than the minimum number of colors offered by a palette, then the minimum will be returned with a warning. The same behavior occurs when *ncolors* is greater than the maximum number of colors a palette supports. :type ncolors: scalar :return clrs: hex values for each color in the palette. :rtype clrs: ncolors x 1 string array Examples ---------------- Basic Usage +++++++++++ :: // Get the first 3 colors from the ColorBrewer 'Dark2' palette clrs = getColorPalette("Dark2", 3); After the above code, *clrs* should equal: :: #1b9e77 #d95f02 #7570b3 These string values in *clrs* are hex values that describe RGB colors. They can be passed directly to any of the GAUSS plotSet functions which take a color as an input. .. seealso:: Functions :func:`listColorPalettes`, :func:`getHSLPalette`, :func:`getHSLuvPalette`, :func:`blendColorPalette`