X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fcolor.h;h=42db83ca5161d6c25c4f3e95f32757c4c753576c;hb=b4d0f1b85a4b359cbf589b23d23c6f8384eec53d;hp=9510b55aecc2d7207564e4bf3b5ffd67f6931b2f;hpb=a9a9ff17449546a0ad9e2f57f4f03aca17020032;p=nothing.git diff --git a/src/color.h b/src/color.h index 9510b55a..42db83ca 100644 --- a/src/color.h +++ b/src/color.h @@ -1,18 +1,19 @@ #ifndef COLOR_H_ #define COLOR_H_ -typedef struct SDL_Color SDL_Color; +#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 color(float r, float g, float b, float a); +Color color256(Uint8 r, Uint8 g, Uint8 b, Uint8 a); +Color color_from_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_