Macros for handling 32-bit color values.
More...
|
| #define | RED(c) (((c)>>24)&0xFF) |
| |
| #define | GREEN(c) (((c)>>16)&0xFF) |
| |
| #define | BLUE(c) (((c)>>8)&0xFF) |
| |
| #define | ALPHA(c) ((c) &0xFF) |
| |
| #define | TO_RGBA(r, g, b, a) |
| |
| #define | TO_IA(i, a) (i&0xff)|((a&0xff)<<8) |
| |
|
|
typedef struct Color4f | Color4f |
| |
|
typedef struct Color4b | Color4b |
| |
|
typedef enum DefaultColor | DefaultColor |
| |
|
| enum | DefaultColor {
Color_White
, Color_Black
, Color_Red
, Color_Green
,
Color_Blue
} |
| |
|
|
Color4f | Color_Create4f (float red, float green, float blue, float alpha) |
| |
|
Color4f | Color_CreateFromPointer4f (Color4f *color) |
| |
|
Color4b | Color_Create4b (u8 red, u8 green, u8 blue, u8 alpha) |
| |
|
Color4f | Color_HexToFloats (u32 color) |
| |
|
Color4b | Color_HexToBytes (u32 color) |
| |
|
u32 | Color_FloatsToHex (Color4f components) |
| |
|
Color4f * | Color_GetDefaultColor (DefaultColor color) |
| |
|
|
GLfloat | Color4f::red |
| |
|
GLfloat | Color4f::green |
| |
|
GLfloat | Color4f::blue |
| |
|
GLfloat | Color4f::alpha |
| |
|
u8 | Color4b::red |
| |
|
u8 | Color4b::green |
| |
|
u8 | Color4b::blue |
| |
|
u8 | Color4b::alpha |
| |
Macros for handling 32-bit color values.
◆ ALPHA
| #define ALPHA |
( |
|
c | ) |
((c) &0xFF) |
Gets the alpha component intensity from a 32-bit color value.
- Parameters
-
| [in] | c | 32-bit RGBA color value |
- Returns
- Alpha component of value
◆ BLUE
| #define BLUE |
( |
|
c | ) |
(((c)>>8)&0xFF) |
Gets the blue component intensity from a 32-bit color value
- Parameters
-
| [in] | c | 32-bit RGBA color value |
- Returns
- Blue component of value
◆ GREEN
| #define GREEN |
( |
|
c | ) |
(((c)>>16)&0xFF) |
Gets the green component intensity from a 32-bit color value.
- Parameters
-
| [in] | c | 32-bit RGBA color value |
- Returns
- Green component of value
◆ RED
| #define RED |
( |
|
c | ) |
(((c)>>24)&0xFF) |
Gets the red component intensity from a 32-bit color value.
- Parameters
-
| [in] | c | 32-bit RGBA color value |
- Returns
- Red component of value
◆ TO_IA
| #define TO_IA |
( |
|
i, |
|
|
|
a |
|
) |
| (i&0xff)|((a&0xff)<<8) |
< Constructs a 32-bit RGBA color value.
- Parameters
-
| [in] | r | Red component |
| [in] | g | Green component |
| [in] | b | Blue component |
| [in] | a | Alpha component |
- Returns
- 32-bit color value Constructs a 16-bit intensity with alpha value.
- Parameters
-
| [in] | i | Intensity component |
| [in] | a | Alpha component |
- Returns
- 16-bit intensity with alpha value
◆ TO_RGBA
| #define TO_RGBA |
( |
|
r, |
|
|
|
g, |
|
|
|
b, |
|
|
|
a |
|
) |
| |
Value: ((u32)((((u32)(r))<<24) | \
((((u32)(g))&0xFF)<<16) | \
((((u32)(b))&0xFF)<<8) | \
(((u32)(a))&0xFF)))