Loxahatchee  v0.0.1-1346
Lox Convenience C++ Library
Lox::Colours Namespace Reference

Several simple methods to handle collections of similar colours. More...

Enumerations

enum  EType {
  kInvalid,
  kUnknown,
  kAll,
  kPairs = 10,
  kNextGradient,
  kGradientMin = 100,
  kGradientDark = kGradientMin,
  kGradientLight,
  kGradientGreenToPurple,
  kGradientYellowToPurple,
  kGradientBlueToPink,
  kGradientYellowToGreen,
  kGradientPurpleToOrange,
  kGradientYellowToBlue,
  kGradientYellowToBlueLight,
  kGradientYellowToBlueDark,
  kGradientMax
}
 

Functions

std::string getNextColour (Lox::VStr &v)
 Get the next available colour from the specified set. More...
 
Lox::VStr getNextGradient (const bool reverse=false, const size_t skip=0)
 Get the next gradient set. More...
 
std::string getRandomColour (void)
 Get a random colour from all the known colours. More...
 
std::string getRandomColour (Lox::VStr &v)
 Get a random colour from the specified set. More...
 
Lox::VStr getRandomGradient (const size_t skip=0)
 Get a random gradient set. More...
 
Lox::VStr getSet (const EType type, const bool reverse=false, const size_t skip=0)
 Get a pre-defined colour set. More...
 

Detailed Description

Several simple methods to handle collections of similar colours.

Enumeration Type Documentation

Enumerator
kInvalid 
kUnknown 
kAll 
kPairs 

return the set of similar pairs (not gradients)

kNextGradient 

return the next gradient set

kGradientMin 
kGradientDark 

return a set of dark colours

kGradientLight 

return a set of light colours

kGradientGreenToPurple 
kGradientYellowToPurple 
kGradientBlueToPink 
kGradientYellowToGreen 
kGradientPurpleToOrange 
kGradientYellowToBlue 
kGradientYellowToBlueLight 
kGradientYellowToBlueDark 
kGradientMax 

Function Documentation

std::string Lox::Colours::getNextColour ( Lox::VStr v)

Get the next available colour from the specified set.

If the vector is empty (no colours remain) then automatically calls getRandomGradient() to repopulate the vector.

References getRandomGradient().

Here is the call graph for this function:

Lox::VStr Lox::Colours::getNextGradient ( const bool  reverse = false,
const size_t  skip = 0 
)

Get the next gradient set.

References getSet(), kGradientMax, kGradientMin, and lastUsedGradient.

Here is the call graph for this function:

std::string Lox::Colours::getRandomColour ( void  )

Get a random colour from all the known colours.

References vAllColours.

std::string Lox::Colours::getRandomColour ( Lox::VStr v)

Get a random colour from the specified set.

If the vector is empty (no colours remain) then automatically calls getRandomGradient() to repopulate the vector.

References initialize(), Lox::Numbers::random(), and vAllColours.

Here is the call graph for this function:

Lox::VStr Lox::Colours::getRandomGradient ( const size_t  skip = 0)

Get a random gradient set.

References getSet(), kGradientMax, kGradientMin, lastUsedGradient, and Lox::Numbers::random().

Referenced by getNextColour().

Here is the call graph for this function:

Here is the caller graph for this function:

Lox::VStr Lox::Colours::getSet ( const EType  type,
const bool  reverse = false,
const size_t  skip = 0 
)