#include <color.h>
Public Types | |
typedef Resource< Color > | Resource |
refcounted resource | |
enum | { WFTK_TRANSPARENT, WFTK_OPAQUE } |
The alpha channel values for transparent and opaque. More... | |
Public Member Functions | |
Color () | |
Default constructor. (opaque black). | |
Color (Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha=WFTK_OPAQUE) | |
Construct from a triple/quadruple. (R, G, B, A). | |
Color (const SDL_Color &c) | |
Construct from SDL_Color. | |
Color (const std::string &name) | |
Construct a named color (as find()). | |
Color (const char *name) | |
same thing, so compiler will autocreate temporaries from "foo" | |
Static Public Member Functions | |
const Color & | find (const std::string &) |
Use the find method to retrieve a color by name (replaces use of static colors in wftk namespace). | |
Public Attributes | |
Uint8 | r |
Red. | |
Uint8 | g |
Green. | |
Uint8 | b |
Blue. | |
Uint8 | a |
Alpha. | |
Static Public Attributes | |
ResourceRegistry< Color, ResLoad, ResInval > | registry |
Load bitmapped surface from file. | |
Friends | |
bool | operator== (const Color &c1, const Color &c2) |
Compares colors (without alpha channel !). | |
bool | operator!= (const Color &c1, const Color &c2) |
Inequality comparison. | |
bool | operator< (const Color &c1, const Color &c2) |
for use with std::map | |
std::ostream & | operator<< (std::ostream &s, const Color &c) |
Operator for output streams. |
|
The alpha channel values for transparent and opaque.
|
|
Load bitmapped surface from file. Use the load() function to register a color resource, using a string specification for the color, giving values for RGB or RGBA, as integers from 0 to 255, e.g.: Use the find() macro to retrieve the color Resource. If the named color has not been registered, find() will return a transparent color.
|
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.