Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBColorManager Class Reference

TBColorManager contains a map of global color names. More...

#include <tb_color.h>

Public Member Functions

void Load (TBNode *n, TBSkin *skin)
 Load a list of colors from a node. More...
 
bool Define (const TBStr &cid, TBColor color)
 Define a color, if not already defined. More...
 
bool IsDefined (const TBStr &cid)
 Is the color defined?
 
bool IsDefined (const TBColor &color)
 Is the color defined?
 
void ReDefine (const TBStr &cid, TBColor color)
 (Re)Define a color, no matter what. More...
 
void Clear ()
 Clear the list of colors. More...
 
TBColor GetColor (const TBStr &cid) const
 Return the color with the given id. More...
 
TBStr GetColorID (const TBColor &color) const
 Return the id of the given color, or 0. More...
 
const std::map< TBStr, TBColorGetColorMap () const
 Return the cid of the given color, or 0. More...
 
void Dump (const TBStr &filename)
 Dump the current color map.
 

Detailed Description

TBColorManager contains a map of global color names.

Member Function Documentation

void tb::TBColorManager::Clear ( )

Clear the list of colors.

bool tb::TBColorManager::Define ( const TBStr cid,
TBColor  color 
)

Define a color, if not already defined.

TBColor tb::TBColorManager::GetColor ( const TBStr cid) const

Return the color with the given id.

If there is no color with that id, 0 will be returned.

TBStr tb::TBColorManager::GetColorID ( const TBColor color) const

Return the id of the given color, or 0.

If there is no color with that id, an empty TBStr() will be returned.

const std::map<TBStr, TBColor> tb::TBColorManager::GetColorMap ( ) const
inline

Return the cid of the given color, or 0.

If there is no color with that cid, 0 will be returned.

void tb::TBColorManager::Load ( TBNode n,
TBSkin skin 
)

Load a list of colors from a node.

void tb::TBColorManager::ReDefine ( const TBStr cid,
TBColor  color 
)

(Re)Define a color, no matter what.


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