MyGUI  3.2.0
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 
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__
static const Colour Blue
Definition: MyGUI_Colour.h:74
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
static const Colour Black
Definition: MyGUI_Colour.h:70
#define MYGUI_EXPORT
static const Colour Red
Definition: MyGUI_Colour.h:72
static const Colour White
Definition: MyGUI_Colour.h:71
static const Colour Zero
Definition: MyGUI_Colour.h:69
static const Colour Green
Definition: MyGUI_Colour.h:73