30 *
this =
parse(_value);
40 return !(*
this == _value);
43 void Colour::set(
float _red,
float _green,
float _blue,
float _alpha)
58 std::ostringstream stream;
69 std::stringstream stream;
70 stream << _value.substr(1);
72 stream >> std::hex >> result;
76 (
unsigned char)(result >> 16) / 256.0f,
77 (
unsigned char)(result >> 8) / 256.0f,
78 (
unsigned char)(result) / 256.0f};
86 std::stringstream stream;
103 _stream << _value.
red <<
" " << _value.
green <<
" " << _value.
blue <<
" " << _value.
alpha;
119 _value =
parse(value);
123 std::istringstream stream(value);
124 stream >> _value.
red;
131 _stream >> _value.
alpha;
constexpr float ALPHA_MAX
static Colour parse(std::string_view _value)
bool operator!=(Colour const &_value) const
std::string print() const
static const Colour Green
static std::istream & operatorShiftRight(std::istream &_stream, Colour &_value)
void set(float _red, float _green, float _blue, float _alpha=1)
static const Colour White
static std::ostream & operatorShiftLeft(std::ostream &_stream, const Colour &_value)
bool operator==(Colour const &_value) const
static const Colour Black