bpp-core3  3.0.0
bpp::DefaultColorSet Class Reference

Default color definitions. More...

#include <Bpp/Graphics/DefaultColorSet.h>

+ Inheritance diagram for bpp::DefaultColorSet:
+ Collaboration diagram for bpp::DefaultColorSet:

Public Member Functions

 DefaultColorSet ()
 
virtual ~DefaultColorSet ()
 
const RGBColorgetColor (const std::string &name) const
 Get the color object corresponding to a given name. More...
 
const RGBColorgetColor (unsigned int index) const
 Get the ith color object in the set. More...
 
std::vector< std::string > getColorNames () const
 
size_t getNumberOfColors () const
 

Protected Attributes

std::map< std::string, RGBColorcolors_
 

Detailed Description

Default color definitions.

Definition at line 53 of file DefaultColorSet.h.

Constructor & Destructor Documentation

◆ DefaultColorSet()

◆ ~DefaultColorSet()

virtual bpp::DefaultColorSet::~DefaultColorSet ( )
inlinevirtual

Definition at line 68 of file DefaultColorSet.h.

Member Function Documentation

◆ getColor() [1/2]

const RGBColor& bpp::AbstractColorSet::getColor ( const std::string &  name) const
inlinevirtualinherited

Get the color object corresponding to a given name.

Parameters
nameThe name of the color to look for.
Returns
The color associated to the given name.
Exceptions
Exceptionif the name is not assigned to any color.

Implements bpp::ColorSet.

Definition at line 109 of file ColorSet.h.

References bpp::AbstractColorSet::colors_.

◆ getColor() [2/2]

const RGBColor& bpp::AbstractColorSet::getColor ( unsigned int  index) const
inlinevirtualinherited

Get the ith color object in the set.

Parameters
indexThe index of the color to look for.
Returns
The color associated to the given index.
Exceptions
IndexOutOfBoundsExceptionif the index is not assigned to any color.

Implements bpp::ColorSet.

Definition at line 116 of file ColorSet.h.

References bpp::AbstractColorSet::colors_.

◆ getColorNames()

std::vector<std::string> bpp::AbstractColorSet::getColorNames ( ) const
inlinevirtualinherited
Returns
All valid color names.

Implements bpp::ColorSet.

Definition at line 124 of file ColorSet.h.

References bpp::AbstractColorSet::colors_, and bpp::MapTools::getKeys().

◆ getNumberOfColors()

size_t bpp::AbstractColorSet::getNumberOfColors ( ) const
inlinevirtualinherited
Returns
The total number of colors available.

Implements bpp::ColorSet.

Definition at line 126 of file ColorSet.h.

References bpp::AbstractColorSet::colors_.

Member Data Documentation

◆ colors_


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