]> git.lizzy.rs Git - nothing.git/blob - src/color.h
14ff2ce5f59ce9bbcd78ab70cfb637a8d08c1981
[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
9 typedef struct Color {
10     float r, g, b, a;
11 } Color;
12
13 Color rgba(float r, float g, float b, float a);
14 Color hexstr(const char *hexstr);
15 SDL_Color color_for_sdl(Color color);
16
17 int color_hex_to_stream(Color color, FILE *stream);
18
19 Color color_darker(Color color, float d);
20
21 Color color_desaturate(Color color);
22
23 Color color_invert(Color c);
24
25 Color color_scale(Color c, Color fc);
26
27 #endif  // COLOR_H_