31 lines
455 B
C++
31 lines
455 B
C++
#ifndef COLOUR_H
|
|
#define COLOUR_H
|
|
|
|
#include <gdkmm/color.h>
|
|
|
|
struct Colour
|
|
{
|
|
Gdk::Color colour;
|
|
float r;
|
|
float g;
|
|
float b;
|
|
|
|
Colour();
|
|
Colour(std::string Code);
|
|
std::string ToCode() const;
|
|
|
|
const Colour operator *(float scale) const
|
|
{
|
|
Colour res = *this;
|
|
res.r *= scale;
|
|
res.g *= scale;
|
|
res.b *= scale;
|
|
if (res.r > 1.0) res.r = 1.0;
|
|
if (res.g > 1.0) res.g = 1.0;
|
|
if (res.b > 1.0) res.b = 1.0;
|
|
return res;
|
|
}
|
|
};
|
|
|
|
#endif // COLOUR_H
|