Ginga  0.13.6
 All Classes Namespaces Functions Variables
Color.h
1 /******************************************************************************
2 Este arquivo eh parte da implementacao do ambiente declarativo do middleware
3 Ginga (Ginga-NCL).
4 
5 Direitos Autorais Reservados (c) 1989-2007 PUC-Rio/Laboratorio TeleMidia
6 
7 Este programa eh software livre; voce pode redistribui-lo e/ou modificah-lo sob
8 os termos da Licenca Publica Geral GNU versao 2 conforme publicada pela Free
9 Software Foundation.
10 
11 Este programa eh distribuido na expectativa de que seja util, porem, SEM
12 NENHUMA GARANTIA; nem mesmo a garantia implicita de COMERCIABILIDADE OU
13 ADEQUACAO A UMA FINALIDADE ESPECIFICA. Consulte a Licenca Publica Geral do
14 GNU versao 2 para mais detalhes.
15 
16 Voce deve ter recebido uma copia da Licenca Publica Geral do GNU versao 2 junto
17 com este programa; se nao, escreva para a Free Software Foundation, Inc., no
18 endereco 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
19 
20 Para maiores informacoes:
21 ncl @ telemidia.puc-rio.br
22 http://www.ncl.org.br
23 http://www.ginga.org.br
24 http://www.telemidia.puc-rio.br
25 ******************************************************************************
26 This file is part of the declarative environment of middleware Ginga (Ginga-NCL)
27 
28 Copyright: 1989-2007 PUC-RIO/LABORATORIO TELEMIDIA, All Rights Reserved.
29 
30 This program is free software; you can redistribute it and/or modify it under
31 the terms of the GNU General Public License version 2 as published by
32 the Free Software Foundation.
33 
34 This program is distributed in the hope that it will be useful, but WITHOUT ANY
35 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
36 PARTICULAR PURPOSE. See the GNU General Public License version 2 for more
37 details.
38 
39 You should have received a copy of the GNU General Public License version 2
40 along with this program; if not, write to the Free Software
41 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
42 
43 For further information contact:
44 ncl @ telemidia.puc-rio.br
45 http://www.ncl.org.br
46 http://www.ginga.org.br
47 http://www.telemidia.puc-rio.br
48 *******************************************************************************/
49 
50 #ifndef _COLOR_H_
51 #define _COLOR_H_
52 
53 #include "util/functions.h"
54 #include "IColor.h"
55 
56 #include <string>
57 #include <iostream>
58 using namespace std;
59 
60 TELEMIDIA_UTIL_BEGIN_DECLS
61 
62 class Color : public IColor {
63  private:
64  int r, g, b, alpha;
65 
66  protected:
67  void setColorToI(string color);
68 
69  public:
70  static const int white = 0XFFFFFF;
71  static const int yellow = 0XFFFF00;
72  static const int red = 0XFF0000;
73  static const int pink = 0XFFC0CB;
74  static const int orange = 0XFFA500;
75  static const int magenta = 0XFF00FF;
76  static const int green = 0X008000;
77  static const int cyan = 0X00FFFF;
78  static const int blue = 0X0000FF;
79  static const int lightGray = 0XD3D3D3;
80  static const int gray = 0X808080;
81  static const int darkGray = 0XA9A9A9;
82  static const int black = 0X000000;
83  static const int silver = 0XC0C0C0;
84  static const int maroon = 0X800000;
85  static const int fuchsia = 0XFF00FF;
86  static const int purple = 0X800080;
87  static const int lime = 0X00FF00;
88  static const int olive = 0X808000;
89  static const int navy = 0X000080;
90  static const int aqua = 0X00FFFF;
91  static const int teal = 0X008080;
92 
93  static const string swhite;
94  static const string syellow;
95  static const string sred;
96  static const string spink;
97  static const string sorange;
98  static const string smagenta;
99  static const string sgreen;
100  static const string scyan;
101  static const string sblue;
102  static const string slightGray;
103  static const string sgray;
104  static const string sdarkGray;
105  static const string sblack;
106  static const string ssilver;
107  static const string smaroon;
108  static const string sfuchsia;
109  static const string spurple;
110  static const string slime;
111  static const string solive;
112  static const string snavy;
113  static const string saqua;
114  static const string steal;
115 
116  static int colortoi(string color);
117  Color();
118  Color(int r, int g, int b, int alpha=255);
119  Color(string color, int alpha=255);
120  void setColor(string color);
121  void setColor(int red, int green, int blue);
122  int getR();
123  int getG();
124  int getB();
125  int getAlpha();
126  uint32_t getRGBA();
127  uint32_t getARGB();
128 };
129 
130 TELEMIDIA_UTIL_END_DECLS
131 
132 #endif //_COLOR_H_
Definition: IColor.h:64
Definition: Color.h:62