]> git.lizzy.rs Git - nothing.git/blob - src/color.h
Merge pull request #918 from tsoding/917
[nothing.git] / src / color.h
1 #ifndef COLOR_H_
2 #define COLOR_H_
3
4 #include <stdio.h>
5 #include <SDL.h>
6
7 #define COLOR_BLACK rgba(0.0f, 0.0f, 0.0f, 1.0f)
8 #define COLOR_WHITE rgba(1.0f, 1.0f, 1.0f, 1.0f)
9
10 typedef struct Color {
11     float r, g, b, a;
12 } Color;
13
14 Color rgba(float r, float g, float b, float a);
15 Color hexstr(const char *hexstr);
16 SDL_Color color_for_sdl(Color color);
17
18 int color_hex_to_stream(Color color, FILE *stream);
19
20 Color color_darker(Color color, float d);
21
22 Color color_desaturate(Color color);
23
24 Color color_invert(Color c);
25
26 Color color_scale(Color c, Color fc);
27
28 #endif  // COLOR_H_