X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fcolor.h;h=1d5730426e2a7f9a6c95441d864ae6645a07e901;hb=a5af6c7fec9c90b475431d9fea760cb5913a4150;hp=c5e29e16fecbd91ef52dcddac64e59dc79ae7f3d;hpb=648f3f0cf7bbe98d02e12a9190701eefa4cbd9b9;p=nothing.git diff --git a/src/color.h b/src/color.h index c5e29e16..1d573042 100644 --- a/src/color.h +++ b/src/color.h @@ -1,18 +1,20 @@ #ifndef COLOR_H_ #define COLOR_H_ -typedef struct SDL_Color SDL_Color; +#include typedef struct color_t { float r, g, b, a; } color_t; -// TODO: color constructor can be easily shadowed in many situation +// 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_t color_darker(color_t color, float d); + color_t color_desaturate(color_t color); #endif // COLOR_H_