29 lines
446 B
C++
29 lines
446 B
C++
#ifndef COLOR_HPP
|
|
#define COLOR_HPP
|
|
|
|
#include <SDL2/SDL_pixels.h>
|
|
|
|
typedef SDL_Color Color;
|
|
|
|
inline Color rgb(uint8_t red, uint8_t green, uint8_t blue)
|
|
{
|
|
SDL_Color color;
|
|
color.r = red;
|
|
color.g = green;
|
|
color.b = blue;
|
|
color.a = 255;
|
|
return color;
|
|
}
|
|
|
|
inline Color rgba(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
|
|
{
|
|
SDL_Color color;
|
|
color.r = red;
|
|
color.g = green;
|
|
color.b = blue;
|
|
color.a = alpha;
|
|
return color;
|
|
}
|
|
|
|
#endif
|