ofxOui - UI Components for OpenFrameworks

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ofxOui::Colormap Class Reference

Sequential Colormap generator. More...

#include <ofxOuiColormap.hpp>

Public Member Functions

 Colormap ()
 Default Constructor. More...
 
virtual ~Colormap ()
 Destructor. More...
 
string getName () const
 get the name of the current colormap More...
 
bool setByName (string name)
 set the colormap by name More...
 
void setBaseColors (vector< ofColor > colors)
 set a colormap from a vector of base colors More...
 
void resize (int num_values)
 resize the colormap More...
 
ofColor sample (float position)
 

Public Attributes

vector< ofColor > values
 vector of colors of the colormap More...
 

Private Member Functions

void generateValues ()
 

Private Attributes

vector< ofColor > base_colors_
 
string current_map_name_
 

Static Private Attributes

static map< string, vector< ofColor > > fabric_
 

Detailed Description

Sequential Colormap generator.

Constructor & Destructor Documentation

§ Colormap()

ofxOui::Colormap::Colormap ( )

Default Constructor.

§ ~Colormap()

ofxOui::Colormap::~Colormap ( )
virtual

Destructor.

Member Function Documentation

§ generateValues()

void ofxOui::Colormap::generateValues ( )
private

§ getName()

string ofxOui::Colormap::getName ( ) const

get the name of the current colormap

Returns
name of the current colormap

§ resize()

void ofxOui::Colormap::resize ( int  num_values)

resize the colormap

Returns
num_values size of the colormap (number of color steps)

§ sample()

ofColor ofxOui::Colormap::sample ( float  position)

§ setBaseColors()

void ofxOui::Colormap::setBaseColors ( vector< ofColor >  colors)

set a colormap from a vector of base colors

Parameters
colorsvector of Colors to of the sequential colormap

§ setByName()

bool ofxOui::Colormap::setByName ( string  name)

set the colormap by name

Parameters
namename of the current colormap
Returns
true if the colormap exists

Member Data Documentation

§ base_colors_

vector<ofColor> ofxOui::Colormap::base_colors_
private

§ current_map_name_

string ofxOui::Colormap::current_map_name_
private

§ fabric_

map< string, vector< ofColor > > ofxOui::Colormap::fabric_
staticprivate
Initial value:
= {
{"winter", {ofColor(0, 0, 255), ofColor(0, 255, 127)}},
{"summer", {ofColor(0, 127, 102), ofColor(255, 255, 102)}},
{"spring", {ofColor(255, 0, 255), ofColor(255, 255, 0)}},
{"autumn", {ofColor(255, 0, 0), ofColor(255, 255, 0)}},
{"bw", {ofColor(0, 0, 0), ofColor(255, 255, 255)}},
}

§ values

vector<ofColor> ofxOui::Colormap::values

vector of colors of the colormap


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