scoop  0.1.4
Scoop - Simple ColoR pAleTtes and mappERs
scoop::ColorPalette Class Reference

Class for color palette. More...

#include <ColorPalette.h>

+ Collaboration diagram for scoop::ColorPalette:

Public Types

enum  ColorBrewerSequential {
  BuGn = 0, BuPu, GnBu, OrRd,
  PuBu, PuBuGn, PuRd, RdPu,
  YlGn, YlGnBu, YlOrBr, YlOrRd,
  Blues, Greens, Greys, Oranges,
  Purples, Reds
}
 Possible ColorBrewer sequential color palette names.
 
enum  ColorBrewerDiverging {
  BrBG, PiYG, PRGn, PurOr,
  RdBu, RdGy, RdYlBu, RdYlGn,
  Spectral
}
 Possible ColorBrewer diverging color palette names.
 
enum  ColorBrewerQualitative {
  Accent, Dark2, Paired, Pastel1,
  Pastel2, Set1, Set2, Set3
}
 Possible ColorBrewer qualitative color palette names.
 
enum  MatplotlibPerceptualUniform { Viridis, Magma, Inferno, Plasma }
 
typedef std::vector< Color > Colors
 Container of color objects.
 

Public Member Functions

const Colorscolors (void) const
 Returns the container of colors of the palette. More...
 
Colorscolors (void)
 Returns the container of colors of the palette. More...
 
unsigned int size (void) const
 Returns the size of the palette. More...
 

Static Public Member Functions

static ColorPalette colorBrewerSequential (ColorBrewerSequential cbPalette=ColorBrewerSequential::BuGn, unsigned int size=3, bool reverse=true)
 Static method to create a palette based on ColorBrewer's sequential palettes. More...
 
static ColorPalette colorBrewerDiverging (ColorBrewerDiverging cbPalette=ColorBrewerDiverging::BrBG, unsigned int size=3, bool reverse=true)
 Static method to create a palette based on ColorBrewer's diverging palettes. More...
 
static ColorPalette colorBrewerQualitative (ColorBrewerQualitative cbPalette=ColorBrewerQualitative::Accent, unsigned int size=3, bool reverse=false)
 Static method to create a palette based on ColorBrewer's qualitative palettes. More...
 
static ColorPalette matplotlibPerceptualUniform (MatplotlibPerceptualUniform mplPalette=MatplotlibPerceptualUniform::Viridis, bool reverse=false)
 

Protected Attributes

Colors _colors
 Container of the colors in the palette.
 

Detailed Description

Class for color palette.

A color palette is simply a container of Color objects

Definition at line 35 of file ColorPalette.h.

Member Function Documentation

static ColorPalette scoop::ColorPalette::colorBrewerDiverging ( ColorBrewerDiverging  cbPalette = ColorBrewerDiverging::BrBG,
unsigned int  size = 3,
bool  reverse = true 
)
static

Static method to create a palette based on ColorBrewer's diverging palettes.

Parameters
[in]cbPalettethe name of the ColorBrewer's diverging pelette
[in]sizethe size of the palette. Size must be between 3 and 11
[in]reverseif the palette is created backwards
Returns
the color palette
static ColorPalette scoop::ColorPalette::colorBrewerQualitative ( ColorBrewerQualitative  cbPalette = ColorBrewerQualitative::Accent,
unsigned int  size = 3,
bool  reverse = false 
)
static

Static method to create a palette based on ColorBrewer's qualitative palettes.

Parameters
[in]cbPalettethe name of the ColorBrewer's qualitative pelette
[in]sizethe size of the palette. Size must be at least 1 and lower than the number of colors available for the palette chosen.
[in]reverseif the palette is created backwards
Returns
the color palette
static ColorPalette scoop::ColorPalette::colorBrewerSequential ( ColorBrewerSequential  cbPalette = ColorBrewerSequential::BuGn,
unsigned int  size = 3,
bool  reverse = true 
)
static

Static method to create a palette based on ColorBrewer's sequential palettes.

Parameters
[in]cbPalettethe name of the ColorBrewer's sequential pelette
[in]sizethe size of the palette. Size must be between 3 and 9.
[in]reverseif the palette is created backwards
Returns
the color palette
const Colors& scoop::ColorPalette::colors ( void  ) const

Returns the container of colors of the palette.

Returns
a const reference to the container

Referenced by scoop::CategoricalColorMap< Category, Hash >::CategoricalColorMap().

+ Here is the caller graph for this function:

Colors& scoop::ColorPalette::colors ( void  )

Returns the container of colors of the palette.

Returns
a copy of the colors in the container
unsigned int scoop::ColorPalette::size ( void  ) const

Returns the size of the palette.

Returns
the number of colors of the palette

Referenced by scoop::CategoricalColorMap< Category, Hash >::CategoricalColorMap().

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: