Color32 Class Reference
Detailed Description
32-bit RGBA color class with 4 unsigned byte components
#include <cyColor.h>
Public Member Functions | |
Constructors | |
| Color32 (Color32 const &c) | |
| Color32 (uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a=255) | |
| Color32 (Color24 const &c, uint8_t _a=255) | |
| template<typename T > | |
| Color32 (Color3< T > const &c, T _a=1) | |
| template<typename T > | |
| Color32 (Color4< T > const &c) | |
Conversion methods | |
| Color | ToColor () const |
| ColorA | ToColorA () const |
Set & Get value methods | |
| void | SetBlack (uint8_t _a=255) |
| Sets r, g, and b components as zero and a component as given. | |
| void | SetWhite (uint8_t _a=255) |
| Sets r, g, and b components as 255 and a component as given. | |
| void | Set (uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a) |
| Sets r, g, b and a components as given. | |
| void | Set (uint8_t const *v) |
| Sets r, g, b and a components using the values in the given array. | |
| void | GetValue (uint8_t *v) const |
| Puts r, g, b and a values into the array. | |
Gray-scale methods | |
| int | Sum () const |
| uint8_t | Gray () const |
| uint8_t | Min () const |
| uint8_t | Max () const |
General methods | |
| bool | IsBlack () const |
| Returns true if the r, g, and b components are exactly zero. | |
Limit methods | |
| void | Clamp (uint8_t limitMin=0, uint8_t limitMax=255) |
| void | ClampMin (uint8_t limitMin=0) |
| void | ClampMax (uint8_t limitMax=255) |
Comparison operators | |
| bool | operator== (Color32 const &c) const |
| bool | operator!= (Color32 const &c) const |
| bool | operator< (Color32 const &c) const |
| bool | operator<= (Color32 const &c) const |
| bool | operator> (Color32 const &c) const |
| bool | operator>= (Color32 const &c) const |
Access operators | |
| uint8_t & | operator[] (int i) |
| uint8_t | operator[] (int i) const |
Public Attributes | |
Color components | |
| uint8_t | r |
| uint8_t | g |
| uint8_t | b |
| uint8_t | a |
Static methods | |
| static Color32 | Black (uint8_t alpha=255) |
| Returns a black color. | |
| static Color32 | White (uint8_t alpha=255) |
| Returns a white color. | |
| template<typename T > | |
| static uint8_t | ToByte (T r) |
| Returns a black color. | |
| static uint8_t | ClampInt (int v) |
| Returns a black color. | |