]> git.lizzy.rs Git - nothing.git/blobdiff - src/color.h
Add TODO(#1248)
[nothing.git] / src / color.h
index a565461f444965fb56254d2836aae45742749352..338a068dd14013388b52c41d6e841948255014a1 100644 (file)
@@ -1,19 +1,34 @@
 #ifndef COLOR_H_
 #define COLOR_H_
 
-#include <SDL2/SDL.h>
+#include <stdio.h>
+#include <SDL.h>
+#include "./system/s.h"
 
-typedef struct color_t {
+#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_t;
+} 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);
 
-color_t color(float r, float g, float b, float a);
-color_t color256(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-color_t color_from_hexstr(const char *hexstr);
-SDL_Color color_for_sdl(color_t color);
+Color color_desaturate(Color color);
 
-color_t color_darker(color_t color, float d);
+Color color_invert(Color c);
 
-color_t color_desaturate(color_t color);
+Color color_scale(Color c, Color fc);
 
 #endif  // COLOR_H_