2013-07-26 22:38:34 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// STL includes
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
// Forward class declaration
|
|
|
|
struct RgbColor;
|
|
|
|
|
|
|
|
struct RgbColor
|
|
|
|
{
|
|
|
|
uint8_t red;
|
|
|
|
uint8_t green;
|
|
|
|
uint8_t blue;
|
|
|
|
|
|
|
|
static RgbColor BLACK;
|
|
|
|
static RgbColor RED;
|
|
|
|
static RgbColor GREEN;
|
|
|
|
static RgbColor BLUE;
|
|
|
|
static RgbColor YELLOW;
|
|
|
|
static RgbColor WHITE;
|
2013-08-13 11:10:45 +02:00
|
|
|
|
2013-07-26 22:38:34 +02:00
|
|
|
};
|
|
|
|
|
2013-08-13 11:10:45 +02:00
|
|
|
static_assert(sizeof(RgbColor) == 3, "Incorrect size of RgbColor");
|
|
|
|
|
|
|
|
|
2013-07-26 22:38:34 +02:00
|
|
|
inline std::ostream& operator<<(std::ostream& os, const RgbColor& color)
|
|
|
|
{
|
|
|
|
os << "{" << unsigned(color.red) << "," << unsigned(color.green) << "," << unsigned(color.blue) << "}";
|
|
|
|
return os;
|
|
|
|
}
|
|
|
|
|