MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_Colour.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_COLOUR_H__
23 #define __MYGUI_COLOUR_H__
24
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Types.h"
27
28 namespace MyGUI
29 {
30
31 struct MYGUI_EXPORT Colour
32 {
33 public:
34 Colour();
35 Colour(float _red, float _green, float _blue, float _alpha = 1);
36 explicit Colour(const std::string& _value);
37
38 Colour& operator = (Colour const& _value);
39 bool operator == (Colour const& _value) const;
40 bool operator != (Colour const& _value) const;
41
42 void set(float _red, float _green, float _blue, float _alpha = 1);
43
44 void clear();
45
46 std::string print() const;
47
48 static Colour parse(const std::string& _value);
49
50 friend std::ostream& operator << (std::ostream& _stream, const Colour& _value)
51 {
52 return operatorShiftLeft(_stream, _value);
53 }
54
55 friend std::istream& operator >> (std::istream& _stream, Colour& _value)
56 {
57 return operatorShiftRight(_stream, _value);
58 }
59
60 static std::ostream& operatorShiftLeft(std::ostream& _stream, const Colour& _value);
61 static std::istream& operatorShiftRight(std::istream& _stream, Colour& _value);
62
63 public:
64 float red;
65 float green;
66 float blue;
67 float alpha;
68
69 static const Colour Zero;
70 static const Colour Black;
71 static const Colour White;
72 static const Colour Red;
73 static const Colour Green;
74 static const Colour Blue;
75 };
76
77 } // namespace MyGUI
78
79 #endif // __MYGUI_COLOUR_H__
MyGUI::Colour::Blue
static const Colour Blue
Definition: MyGUI_Colour.h:74
MyGUI_Prerequest.h
MyGUI::Colour::green
float green
Definition: MyGUI_Colour.h:65
MyGUI::operator!=
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1049
MyGUI::operator==
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1046
MyGUI_Types.h
MyGUI::Colour::Black
static const Colour Black
Definition: MyGUI_Colour.h:70
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI::Colour::Red
static const Colour Red
Definition: MyGUI_Colour.h:72
MyGUI::Colour::red
float red
Definition: MyGUI_Colour.h:64
MyGUI::Colour
Definition: MyGUI_Colour.h:31
MyGUI::Colour::White
static const Colour White
Definition: MyGUI_Colour.h:71
MyGUI::Colour::Zero
static const Colour Zero
Definition: MyGUI_Colour.h:69
MyGUI::Colour::alpha
float alpha
Definition: MyGUI_Colour.h:67
MyGUI::Colour::blue
float blue
Definition: MyGUI_Colour.h:66
MyGUI::Colour::Green
static const Colour Green
Definition: MyGUI_Colour.h:73