edelib  2.0.0
Public Member Functions
ColorDb Class Reference

X11 color database. More...

#include <edelib/ColorDb.h>

List of all members.

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)

Detailed Description

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.


Constructor & Destructor Documentation

ColorDb ( )

Constructor.

~ColorDb ( )

Destructor.


Member Function Documentation

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.


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