MyGUI: MyGUI_Colour.h Source File

MyGUI 3.4.2

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

- File List
- Globals

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
13namespace 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 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_
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_Types.h
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::Colour
Definition MyGUI_Colour.h:17
MyGUI::Colour::Colour
Colour(const Colour &_value)=default
MyGUI::Colour::green
float green
Definition MyGUI_Colour.h:51
MyGUI::Colour::blue
float blue
Definition MyGUI_Colour.h:52
MyGUI::Colour::Green
static const Colour Green
Definition MyGUI_Colour.h:59
MyGUI::Colour::Zero
static const Colour Zero
Definition MyGUI_Colour.h:55
MyGUI::Colour::Red
static const Colour Red
Definition MyGUI_Colour.h:58
MyGUI::Colour::alpha
float alpha
Definition MyGUI_Colour.h:53
MyGUI::Colour::Blue
static const Colour Blue
Definition MyGUI_Colour.h:60
MyGUI::Colour::White
static const Colour White
Definition MyGUI_Colour.h:57
MyGUI::Colour::red
float red
Definition MyGUI_Colour.h:50
MyGUI::Colour::Black
static const Colour Black
Definition MyGUI_Colour.h:56