MyGUI 3.2.2

MyGUI_Colour.h
Go to the documentation of this file.
1 /*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7 #ifndef MYGUI_COLOUR_H_
8 #define MYGUI_COLOUR_H_
9
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Types.h"
12
13 namespace MyGUI
14 {
15
16 struct MYGUI_EXPORT Colour
17 {
18 public:
19 Colour();
20 Colour(float _red, float _green, float _blue, float _alpha = 1);
21 explicit Colour(const std::string& _value);
22
23 Colour& operator = (Colour const& _value);
24 bool operator == (Colour const& _value) const;
25 bool operator != (Colour const& _value) const;
26
27 void set(float _red, float _green, float _blue, float _alpha = 1);
28
29 void clear();
30
31 std::string print() const;
32
33 static Colour parse(const std::string& _value);
34
35 friend std::ostream& operator << (std::ostream& _stream, const Colour& _value)
36 {
37 return operatorShiftLeft(_stream, _value);
38 }
39
40 friend std::istream& operator >> (std::istream& _stream, Colour& _value)
41 {
42 return operatorShiftRight(_stream, _value);
43 }
44
45 static std::ostream& operatorShiftLeft(std::ostream& _stream, const Colour& _value);
46 static std::istream& operatorShiftRight(std::istream& _stream, Colour& _value);
47
48 public:
49 float red;
50 float green;
51 float blue;
52 float alpha;
53
54 static const Colour Zero;
55 static const Colour Black;
56 static const Colour White;
57 static const Colour Red;
58 static const Colour Green;
59 static const Colour Blue;
60 };
61
62 } // namespace MyGUI
63
64 #endif // MYGUI_COLOUR_H_
MyGUI::Colour::Blue
static const Colour Blue
Definition: MyGUI_Colour.h:59
MyGUI_Prerequest.h
MyGUI::Colour::green
float green
Definition: MyGUI_Colour.h:50
MyGUI::operator!=
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1048
MyGUI::operator==
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1045
MyGUI_Types.h
MyGUI::Colour::Black
static const Colour Black
Definition: MyGUI_Colour.h:55
MyGUI
Definition: MyGUI_ActionController.h:14
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::Colour::Red
static const Colour Red
Definition: MyGUI_Colour.h:57
MyGUI::Colour::red
float red
Definition: MyGUI_Colour.h:49
MyGUI::Colour
Definition: MyGUI_Colour.h:16
MyGUI::Colour::White
static const Colour White
Definition: MyGUI_Colour.h:56
MyGUI::Colour::Zero
static const Colour Zero
Definition: MyGUI_Colour.h:54
MyGUI::Colour::alpha
float alpha
Definition: MyGUI_Colour.h:52
MyGUI::Colour::blue
float blue
Definition: MyGUI_Colour.h:51
MyGUI::Colour::Green
static const Colour Green
Definition: MyGUI_Colour.h:58