]> git.lizzy.rs Git - nothing.git/blob - src/color.h
Fix PlayerLayer click-through problem
[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 #define COLOR_RED rgba(1.0f, 0.0f, 0.0f, 1.0f)
10
11 typedef struct Color {
12     float r, g, b, a;
13 } Color;
14
15 Color rgba(float r, float g, float b, float a);
16 Color hsla(float h, float s, float l, float a);
17 Color rgba_to_hsla(Color color);
18 Color hexstr(const char *hexstr);
19 SDL_Color color_for_sdl(Color color);
20
21 int color_hex_to_stream(Color color, FILE *stream);
22
23 Color color_darker(Color color, float d);
24
25 Color color_desaturate(Color color);
26
27 Color color_invert(Color c);
28
29 Color color_scale(Color c, Color fc);
30
31 #endif  // COLOR_H_