]> git.lizzy.rs Git - nothing.git/blobdiff - src/color.h
Remove Grid and ActionPicker
[nothing.git] / src / color.h
index b9dd99f6bde733b48ab45042e5787e079a4acae0..cffb7cf613f7e787d84fc6d76f58cb3447a27935 100644 (file)
@@ -3,19 +3,25 @@
 
 #include <stdio.h>
 #include <SDL.h>
+#include "./system/s.h"
 
 #define COLOR_BLACK rgba(0.0f, 0.0f, 0.0f, 1.0f)
 #define COLOR_WHITE rgba(1.0f, 1.0f, 1.0f, 1.0f)
+#define COLOR_RED rgba(1.0f, 0.0f, 0.0f, 1.0f)
 
 typedef struct Color {
     float r, g, b, a;
 } Color;
 
 Color rgba(float r, float g, float b, float a);
+Color hsla(float h, float s, float l, float a);
+Color rgba_to_hsla(Color color);
 Color hexstr(const char *hexstr);
+Color hexs(String input);
 SDL_Color color_for_sdl(Color color);
 
 int color_hex_to_stream(Color color, FILE *stream);
+int color_hex_to_string(Color color, char *buffer, size_t buffer_size);
 
 Color color_darker(Color color, float d);
 
@@ -25,4 +31,11 @@ Color color_invert(Color c);
 
 Color color_scale(Color c, Color fc);
 
+static inline
+Color color_set_alpha(Color c, float a)
+{
+    c.a = a;
+    return c;
+}
+
 #endif  // COLOR_H_