Color24 Class Reference
Detailed Description
24-bit RGB color class with 3 unsigned byte components
#include <cyColor.h>
Public Member Functions | |
Constructors | |
| Color24 (Color24 const &c) | |
| Color24 (uint8_t _r, uint8_t _g, uint8_t _b) | |
| Color24 (Color32 const &c) | |
| template<typename T > | |
| Color24 (Color3< T > const &c) | |
| template<typename T > | |
| Color24 (Color4< T > const &c) | |
Conversion methods | |
| Color | ToColor () const |
| ColorA | ToColorA () const |
Set & Get value methods | |
| void | SetBlack () |
| Sets r, g, and b components as zero. | |
| void | SetWhite () |
| Sets r, g, and b components as 255. | |
| void | Set (uint8_t _r, uint8_t _g, uint8_t _b) |
| Sets r, g, and b components as given. | |
| void | Set (uint8_t const *v) |
| Sets r, g, and b components using the values in the given array. | |
| void | GetValue (uint8_t *v) const |
| Puts r, g, and b 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 all 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== (Color24 const &c) const |
| bool | operator!= (Color24 const &c) const |
| bool | operator< (Color24 const &c) const |
| bool | operator<= (Color24 const &c) const |
| bool | operator> (Color24 const &c) const |
| bool | operator>= (Color24 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 |
Static methods | |
| static Color24 | Black () |
| Returns a black color. | |
| static Color24 | White () |
| 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. | |