]> git.lizzy.rs Git - nothing.git/blobdiff - src/color.h
Merge pull request #505 from tsoding/108
[nothing.git] / src / color.h
index c5e29e16fecbd91ef52dcddac64e59dc79ae7f3d..3740b5fbcb29afac1f5ab7ea1d472a8e8894d923 100644 (file)
@@ -1,18 +1,18 @@
 #ifndef COLOR_H_
 #define COLOR_H_
 
-typedef struct SDL_Color SDL_Color;
+#include <SDL2/SDL.h>
 
-typedef struct color_t {
+typedef struct Color {
     float r, g, b, a;
-} color_t;
+} Color;
 
-// TODO: color constructor can be easily shadowed in many situation
-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 rgba(float r, float g, float b, float a);
+Color hexstr(const char *hexstr);
+SDL_Color color_for_sdl(Color color);
 
-color_t color_desaturate(color_t color);
+Color color_darker(Color color, float d);
+
+Color color_desaturate(Color color);
 
 #endif  // COLOR_H_