ofxAlbers
A colour addon for OpenFrameworks
Public Member Functions | List of all members
MonochromePalette Class Reference

Functionality for constructing and manipulating Monochromatic colour schemes. More...

#include <MonochromePalette.h>

Inheritance diagram for MonochromePalette:
TheoryPalette ColourPalette

Public Member Functions

SharedPtrColVec createPalette (const ofColor &_seedColour)
 Main method for creating monochrome colour schemes from a seed colour. More...
 
void setSaturationDif (const int &_satDif)
 Adjusts the satDif (the saturation) between the colours in the colour scheme, and updates the colour vec. More...
 
void setBrightnessDif (const int &_briDif)
 Adjusts the briDif (the brightness) between the colours in the colour scheme, and updates the colour vec. More...
 
 MonochromePalette (int _satDif=25, int _briDif=25)
 Construct a Monochrome Palette object and set relevant vars. More...
 
 MonochromePalette (const MonochromePalette &old)
 MonochromePalette's copy constructor. Creates a 'unique' shared pointer from the old one as we don't want it to point to the previous instantiation's 'colours'.
 
- Public Member Functions inherited from TheoryPalette
 TheoryPalette ()
 Constructor used to instantiate member objects, viz. 'colours'.
 
void populatePalette (const ColVec &oldVec)
 Populates the colours vector. More...
 
SharedPtrColVec generateRandom ()
 Generate a random colour scheme. Useful for quickly generating pleasing colours to use.
 
- Public Member Functions inherited from ColourPalette
 ColourPalette ()
 Constructor used to instantiate member objects, viz. 'colours'.
 
 ColourPalette (const ColourPalette &old)
 ABS's copy constructor. Creates a 'unique' shared pointer from the old one as we don't want it to point to the previous instantiation's 'colours'.
 
void operator= (const ColourPalette &old)
 ABS's assignment operator. Creates a 'unique' shared pointer from the old one as we don't want it to point to the previous instantiation's 'colours'.
 
SharedPtrColVec getPalette () const
 Generic colour scheme getter. Returns a shared pointer to the colour scheme itself. More...
 
void sortPalette (string channel="hue")
 Used to sort the palette of colours based on chosen channel. More...
 
void darken (unsigned int percent)
 Used to darken a colour scheme by a given percentage. More...
 
void lighten (unsigned int percent)
 Used to lighten a colour scheme by a given percentage. More...
 
void saturate (unsigned int percent)
 Used to saturate a colour scheme by a given percentage. More...
 
void desaturate (unsigned int percent)
 Used to desaturate a colour scheme by a given percentage. More...
 
void adjustHue (int percent)
 Used to adjust the hue by a given percentage - n.b. can be a negative value. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ColourPalette
static ofColor darken (ofColor &col, unsigned int percent)
 Used to darken a colour by a given percentage. More...
 
static ofColor lighten (ofColor &col, unsigned int percent)
 Used to lighten a colour by a given percentage. More...
 
static ofColor saturate (ofColor &col, unsigned int percent)
 Used to saturate a colour by a given percentage. More...
 
static ofColor desaturate (ofColor &col, unsigned int percent)
 Used to desaturate a colour by a given percentage. More...
 
static ofColor adjustHue (ofColor &col, int percent)
 Used to adjust the hue by a given percentage - n.b. can be a negative value. More...
 
- Protected Attributes inherited from ColourPalette
SharedPtrColVec colours
 stores the of representation of the generated colours.
 
ofColor seedColour = ofColor(255, 255, 255)
 the base colour with which to generate a scheme from.
 

Detailed Description

Functionality for constructing and manipulating Monochromatic colour schemes.

Author
James Oldfield.

Constructor & Destructor Documentation

MonochromePalette::MonochromePalette ( int  _satDif = 25,
int  _briDif = 25 
)

Construct a Monochrome Palette object and set relevant vars.

Parameters
_satDifThe amount to space out the saturation by.
_briDifThe amount to space out the brightness by.

Member Function Documentation

SharedPtrColVec MonochromePalette::createPalette ( const ofColor &  _seedColour)
virtual

Main method for creating monochrome colour schemes from a seed colour.

Parameters
_seedColourThe ofColor seed/base colour with which to construct the palette from.
Returns
A shared_ptr<vector<ofColor>> (typedef'd - SharedPtrColVec) to the vector of of colours.

Implements TheoryPalette.

void MonochromePalette::setBrightnessDif ( const int &  _briDif)

Adjusts the briDif (the brightness) between the colours in the colour scheme, and updates the colour vec.

Parameters
_briDifThe value to offset the brightness values by in the colour scheme by.
void MonochromePalette::setSaturationDif ( const int &  _satDif)

Adjusts the satDif (the saturation) between the colours in the colour scheme, and updates the colour vec.

Parameters
_satDifThe value to offset the saturation values by in the colour scheme by.

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