edelib
2.1.0
|
X11 color database. More...
#include <edelib/ColorDb.h>
Public Member Functions | |
ColorDb () | |
~ColorDb () | |
bool | load (void) |
bool | load (const char *file) |
bool | find (const char *name, unsigned char &r, unsigned char &g, unsigned char &b) |
X11 color database.
ColorDb handles X11 color database, usualy stored in /usr/share/X11/rgb.txt. The main intent is to provide human readable color names that will be resolved to associated rgb values.
ColorDb | ( | ) |
Constructor.
~ColorDb | ( | ) |
Destructor.
bool find | ( | const char * | name, |
unsigned char & | r, | ||
unsigned char & | g, | ||
unsigned char & | b | ||
) |
Lookup given name and return RGB triplet. If name wasn't found, it will only return false.
bool load | ( | void | ) |
Load and parse database file from known locations (/etc/X11/rgb.txt or /usr/share/X11/rgb.txt). Returns true if loaded something meaningful.
bool load | ( | const char * | file | ) |
Explicitly load database from given file. Return false if fails.