31 lines
724 B
C++
31 lines
724 B
C++
#ifndef Color_h_
|
|
#define Color_h_
|
|
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
#include <cmath>
|
|
#include <ostream>
|
|
|
|
#include "SDL_pixels.h"
|
|
|
|
struct Color
|
|
{
|
|
|
|
std::uint8_t r, g, b, a;
|
|
|
|
Color();
|
|
Color(std::uint8_t, std::uint8_t, std::uint8_t, std::uint8_t = 255);
|
|
Color(const SDL_Color&);
|
|
void set_rgb_float(const float&, const float&, const float&);
|
|
void set_hsv(const float&, const float& = 1.0f, const float& = 1.0f);
|
|
void shift_hue(float);
|
|
SDL_Color get_sdl_color();
|
|
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream&, const Color&);
|
|
void RGBtoHSV(const float&, const float&, const float&, float&, float&, float&);
|
|
void HSVtoRGB(float&, float&, float&, const float&, const float&, const float&);
|
|
|
|
#endif
|