#endif
}
+ bool operator==(const Color& other) const
+ {
+ return red == other.red && green == other.green && blue == other.blue
+ && alpha == other.alpha;
+ }
+
void check_color_ranges()
{
if(red < 0 || red > 1.0 || green < 0 || green > 1.0
log_warning << "color value out of range: " << red << ", " << green << ", " << blue << ", " << alpha << std::endl;
}
+ float greyscale() const
+ {
+ return red * 0.30 + green * 0.59 + blue * 0.11;
+ }
+
+ bool operator < (const Color& other) const
+ {
+ return greyscale() < other.greyscale();
+ }
+
float red, green, blue, alpha;
};