1.1.0
color.h
1 #ifndef FONT_CHEF_COLOR_H
2 #define FONT_CHEF_COLOR_H
3 
14 #include "font-chef/font-chef-export.h"
15 #include <stdint.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
25 struct fc_color {
27  uint8_t r;
28 
30  uint8_t g;
31 
33  uint8_t b;
34 
36  uint8_t a;
37 };
38 
53 FONT_CHEF_EXPORT extern void fc_color_construct(struct fc_color * color);
54 
71 FONT_CHEF_EXPORT extern void fc_color_set(struct fc_color * color, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
72 
88 FONT_CHEF_EXPORT extern struct fc_color fc_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
89 
104 FONT_CHEF_EXPORT extern struct fc_color fc_rgb(uint8_t r, uint8_t g, uint8_t b);
105 
119 FONT_CHEF_EXPORT extern struct fc_color fc_0xrgb(uint32_t color);
120 
121 
135 FONT_CHEF_EXPORT extern struct fc_color fc_0xrgba(uint32_t color);
136 
141 FONT_CHEF_EXPORT extern struct fc_color const fc_color_red;
142 
147 FONT_CHEF_EXPORT extern struct fc_color const fc_color_green;
148 
153 FONT_CHEF_EXPORT extern struct fc_color const fc_color_blue;
154 
159 FONT_CHEF_EXPORT extern struct fc_color const fc_color_white;
160 
165 FONT_CHEF_EXPORT extern struct fc_color const fc_color_black;
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif /* FONT_CHEF_COLOR_H */
fc_color::r
uint8_t r
Definition: color.h:27
fc_color_black
struct fc_color const fc_color_black
RGBA: #000000FF
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.
fc_color_red
struct fc_color const fc_color_red
RGBA: #FF0000FF
fc_color_white
struct fc_color const fc_color_white
RGBA: #FFFFFFFF
fc_color::g
uint8_t g
Definition: color.h:30
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)
fc_color::a
uint8_t a
Definition: color.h:36
fc_color
Represents a 4-byte-per-pixel color with red, green, blue and alpha components.
Definition: color.h:25
fc_color_blue
struct fc_color const fc_color_blue
RGBA: #0000FFFF
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...
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.
fc_color_green
struct fc_color const fc_color_green
RGBA: #00FF00FF
fc_color::b
uint8_t b
Definition: color.h:33
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...
fc_color_construct
void fc_color_construct(struct fc_color *color)
Zeroes all fields of a fc_color structure.