MyGUI  3.4.1
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 
17  {
18  public:
19  Colour();
20  Colour(float _red, float _green, float _blue, float _alpha = 1);
21  Colour(const Colour& _value) = default;
22  explicit Colour(const std::string& _value);
23 
24  Colour& operator = (Colour const& _value);
25  bool operator == (Colour const& _value) const;
26  bool operator != (Colour const& _value) const;
27 
28  void set(float _red, float _green, float _blue, float _alpha = 1);
29 
30  void clear();
31 
32  std::string print() const;
33 
34  static Colour parse(const std::string& _value);
35 
36  friend std::ostream& operator << (std::ostream& _stream, const Colour& _value)
37  {
38  return operatorShiftLeft(_stream, _value);
39  }
40 
41  friend std::istream& operator >> (std::istream& _stream, Colour& _value)
42  {
43  return operatorShiftRight(_stream, _value);
44  }
45 
46  static std::ostream& operatorShiftLeft(std::ostream& _stream, const Colour& _value);
47  static std::istream& operatorShiftRight(std::istream& _stream, Colour& _value);
48 
49  public:
50  float red;
51  float green;
52  float blue;
53  float alpha;
54 
55  static const Colour Zero;
56  static const Colour Black;
57  static const Colour White;
58  static const Colour Red;
59  static const Colour Green;
60  static const Colour Blue;
61  };
62 
63 } // namespace MyGUI
64 
65 #endif // MYGUI_COLOUR_H_
#define MYGUI_EXPORT
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)
Colour(const Colour &_value)=default
static const Colour Green
Definition: MyGUI_Colour.h:59
static const Colour Zero
Definition: MyGUI_Colour.h:55
static const Colour Red
Definition: MyGUI_Colour.h:58
static const Colour Blue
Definition: MyGUI_Colour.h:60
static const Colour White
Definition: MyGUI_Colour.h:57
static const Colour Black
Definition: MyGUI_Colour.h:56