X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fcolor.h;h=d169df2cf5bfe84a591e5cceaafd45e5943268f3;hb=6679a839e4ce3d4c5e027dfe2ccd83e2d12ba1c1;hp=29614ebefd9ac673ebca740b65b1751e63b0332f;hpb=5b8052c137551889af5e4a11e69e2152c2ccedf5;p=nothing.git diff --git a/src/color.h b/src/color.h index 29614ebe..d169df2c 100644 --- a/src/color.h +++ b/src/color.h @@ -3,16 +3,18 @@ #include -typedef struct color_t { +typedef struct Color { float r, g, b, a; -} color_t; +} Color; -// TODO(#108): 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); + +Color color_invert(Color c); #endif // COLOR_H_