#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 | |
| static 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 | |
| static 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.: Color::registry.load("blue", "0 0 255"); Color::registry.load("grey25", "128 128 128 64"); myWidget->setColor(&Color::registry.find("blue")); |
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.