Loading...
Searching...
No Matches
color.h File Reference

Headers for the color handling module. More...

Detailed Description

#include <stdint.h>
+ Include dependency graph for color.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  color_rgb_t
 Data-structure describing a RGB color. More...
 
struct  color_rgba_t
 RGBA color value. More...
 
struct  color_hsv_t
 Data-structure for holding HSV colors. More...
 

Functions

void color_rgb2hsv (color_rgb_t *rgb, color_hsv_t *hsv)
 Convert RGB color to HSV color.
 
void color_hsv2rgb (color_hsv_t *hsv, color_rgb_t *rgb)
 Convert HSV color to RGB color.
 
void color_hex2rgb (const uint32_t hex, color_rgb_t *rgb)
 Convert a hex value of the form 0x00RRGGBB to an RGB color struct.
 
void color_rgb2hex (const color_rgb_t *rgb, uint32_t *hex)
 Convert a rgb struct to a hex value of the form 0x00RRGGBB.
 
void color_str2rgb (const char *str, color_rgb_t *color)
 Convert a hex color string of the form 'RRGGBB' to a color_rgb_t struct.
 
void color_rgb2str (const color_rgb_t *rgb, char *str)
 Convert a color_rgb_t struct to a hex color string of the form 'RRGGBB'.
 
static void color_rgb_invert (const color_rgb_t *rgb, color_rgb_t *inv_rgb)
 Invert a given rgb color.
 
static void color_rgb_shift (const color_rgb_t *rgb, color_rgb_t *out, int8_t shift)
 Shifts a given rgb color to change it's brightness.
 
static void color_rgb_set_brightness (const color_rgb_t *rgb, color_rgb_t *out, uint8_t level)
 Change the brightness of a RGB color by multiplying it with a set factor.
 
void color_rgb_complementary (const color_rgb_t *rgb, color_rgb_t *comp_rgb)
 Calculate the complementary color of a given rgb color.