All the functions and types that deal with font colors.
More...
|
void | fc_color_construct (struct fc_color *color) |
| Zeroes all fields of a fc_color structure. More...
|
|
void | fc_color_set (struct fc_color *color, uint8_t r, uint8_t g, uint8_t b, uint8_t a) |
| Sets all fields of a fc_color structure at once. More...
|
|
struct fc_color | fc_rgba (uint8_t r, uint8_t g, uint8_t b, uint8_t a) |
| Constructs and return a fc_color value with the provided components set. More...
|
|
struct fc_color | fc_rgb (uint8_t r, uint8_t g, uint8_t b) |
| Constructs and return a fc_color value with the provided components set and alpha set as 255 (opaque) More...
|
|
struct fc_color | fc_0xrgb (uint32_t color) |
| Constructs and return a fc_color value with red, green and blue components extracted from an unsigned 32-bit integer, sets alpha to 255. More...
|
|
struct fc_color | fc_0xrgba (uint32_t color) |
| Constructs and return a fc_color value with red, green and blue components extracted from an unsigned 32-bit integer. More...
|
|
All the functions and types that deal with font colors.
◆ fc_color_construct()
void fc_color_construct |
( |
struct fc_color * |
color | ) |
|
Zeroes all fields of a fc_color
structure.
Note that simply using struct fc_color color = {}
is equivalent and faster.
Example
- Parameters
-
◆ fc_color_set()
void fc_color_set |
( |
struct fc_color * |
color, |
|
|
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b, |
|
|
uint8_t |
a |
|
) |
| |
Sets all fields of a fc_color
structure at once.
Example
- Parameters
-
color | A pointer to a fc_color value to be set |
r | The red component to be set |
g | The green component to be set |
b | The blue component to be set |
a | The alpha component to be set |
◆ fc_rgba()
struct fc_color fc_rgba |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b, |
|
|
uint8_t |
a |
|
) |
| |
Constructs and return a fc_color
value with the provided components set.
Example
- Parameters
-
r | The red component |
g | The green component |
b | The blue component |
a | The alpha component |
- Returns
- A
fc_color
value with the components set
◆ fc_rgb()
struct fc_color fc_rgb |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b |
|
) |
| |
Constructs and return a fc_color
value with the provided components set and alpha set as 255 (opaque)
Example
- Parameters
-
r | The red component |
g | The green component |
b | The blue component |
- Returns
- A
fc_color
value with the components set and alpha set to 255
◆ fc_0xrgb()
struct fc_color fc_0xrgb |
( |
uint32_t |
color | ) |
|
Constructs and return a fc_color
value with red, green and blue components extracted from an unsigned 32-bit integer, sets alpha to 255.
Example
- Parameters
-
color | The color encoded as 32-bit unsigned integer to use |
- Returns
- A
fc_color
value with the components extracted from the integer and alpha set to 255
◆ fc_0xrgba()
struct fc_color fc_0xrgba |
( |
uint32_t |
color | ) |
|
Constructs and return a fc_color
value with red, green and blue components extracted from an unsigned 32-bit integer.
Example
- Parameters
-
color | The color encoded as 32-bit unsigned integer to use |
- Returns
- A
fc_color
value with the components extracted from the integer
struct fc_color fc_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Constructs and return a fc_color value with the provided components set.
struct fc_color fc_rgb(uint8_t r, uint8_t g, uint8_t b)
Constructs and return a fc_color value with the provided components set and alpha set as 255 (opaque)
struct fc_color fc_0xrgba(uint32_t color)
Constructs and return a fc_color value with red, green and blue components extracted from an unsigned...
void fc_color_set(struct fc_color *color, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Sets all fields of a fc_color structure at once.
struct fc_color fc_0xrgb(uint32_t color)
Constructs and return a fc_color value with red, green and blue components extracted from an unsigned...