53 *
this =
parse(_value);
72 return ! (*
this == _value);
75 void Colour::set(
float _red,
float _green,
float _blue,
float _alpha)
90 std::ostringstream stream;
101 std::istringstream stream(_value.substr(1));
103 stream >> std::hex >> result;
106 return Colour( (
unsigned char)( result >> 16 ) / 256.0f, (
unsigned char)( result >> 8 ) / 256.0f, (
unsigned char)( result ) / 256.0f );
112 std::istringstream stream(_value);
113 stream >> red >> green >>
blue;
119 return Colour(red, green, blue, alpha);
128 _stream << _value.
red <<
" " << _value.
green <<
" " << _value.
blue <<
" " << _value.
alpha;
144 _value =
parse(value);
148 std::istringstream stream(value);
149 stream >> _value.
red;
156 _stream >> _value.
alpha;
bool operator==(Colour const &_value) const
Colour & operator=(Colour const &_value)
bool operator!=(Colour const &_value) const
static std::ostream & operatorShiftLeft(std::ostream &_stream, const Colour &_value)
void set(float _red, float _green, float _blue, float _alpha=1)
static const Colour Black
std::string print() const
static std::istream & operatorShiftRight(std::istream &_stream, Colour &_value)
static Colour parse(const std::string &_value)
static const Colour White
static const Colour Green