24 #ifndef __COLORSCHEMA_H
25 #define __COLORSCHEMA_H
28 #include <selforg/stl_map.h>
44 typedef HashMap<std::string, AliasVector >
AliasMap;
53 Color color(
const std::string& name_or_id_or_alias)
const;
58 Color color(
const std::string& name_or_id_or_alias,
int alias_set)
const;
64 int alias_set = 0)
const;
77 int loadAliases(
const std::string& filename,
int alias_set_offset = 0);
91 bool addAlias(
const std::string& name,
const std::string& alias,
int alias_set = 0);
100 void print(std::ostream& out)
const ;
int loadPalette(const std::string &gplfilename)
loads a gpl (gimp pallette file) and returns the number loaded colors The name of the colors should n...
Definition: colorschema.cpp:102
void setDefaultColor(const Color &c)
Definition: colorschema.cpp:202
std::string getLoadErrorString(int value) const
returns error string for value returned by loadPalette and loadAliases
Definition: colorschema.cpp:83
bool existsColor(const std::string &name) const
checks whether color with the name exists (no aliases are checked)
Definition: colorschema.cpp:210
HashMap< std::string, AliasVector > AliasMap
Definition: colorschema.h:44
bool getColor(Color &, const std::string &name) const
Definition: colorschema.cpp:241
A store for colors with a set of aliases.
Definition: colorschema.h:39
std::vector< std::string > AliasVector
Definition: colorschema.h:43
int loadAliases(const std::string &filename, int alias_set_offset=0)
loads aliases from text file with lines containing: aliasname colorname/id [alias-set] ...
Definition: colorschema.cpp:140
const Color & getDefaultColor() const
Definition: colorschema.cpp:206
HashMap< std::string, Color > ColorMap
Definition: colorschema.h:42
void addColor(const Color &color, const std::string &name)
adds a color to the color store (to add the id call the function twice with id as name) ...
Definition: colorschema.cpp:168
ColorSchema()
Definition: colorschema.cpp:43
int c
Definition: hexapod.cpp:56
void print(std::ostream &out) const
prints all colors and aliases
Definition: colorschema.cpp:226
Color color(const std::string &name_or_id_or_alias) const
retrieves a color with the given name/id/alias if no color is found that matches the id/alias then th...
bool addAlias(const std::string &name, const std::string &alias, int alias_set=0)
adds a color alias (into the given alias-set)
Definition: colorschema.cpp:172