libyui
 
Loading...
Searching...
No Matches
YColor.h
1/*
2 Copyright (C) 2000-2012 Novell, Inc
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) version 3.0 of the License. This library
7 is distributed in the hope that it will be useful, but WITHOUT ANY
8 WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 License for more details. You should have received a copy of the GNU
11 Lesser General Public License along with this library; if not, write
12 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 Floor, Boston, MA 02110-1301 USA
14*/
15
16
17/*-/
18
19 File: YColor.h
20
21 Author: Stefan Hundhammer <shundhammer@suse.de>
22
23/-*/
24
25#ifndef YColor_h
26#define YColor_h
27
28typedef unsigned char uchar;
29
30
34class YColor
35{
36public:
40 YColor( uchar red, uchar green, uchar blue )
41 : _red ( red )
42 , _green( green )
43 , _blue ( blue )
44 , _undef( false )
45 {}
46
51 : _red( 0 ), _green( 0 ), _blue( 0 )
52 , _undef( true )
53 {}
54
58 uchar red() const { return _red; }
59
63 uchar green() const { return _green; }
64
68 uchar blue() const { return _blue; }
69
73 bool isUndefined() const { return _undef; }
74
78 bool isDefined() const { return ! _undef; }
79
80private:
81
82 uchar _red;
83 uchar _green;
84 uchar _blue;
85
86 bool _undef;
87};
88
89
90#endif // YColor_h
uchar blue() const
Definition YColor.h:68
bool isUndefined() const
Definition YColor.h:73
uchar red() const
Definition YColor.h:58
YColor(uchar red, uchar green, uchar blue)
Definition YColor.h:40
uchar green() const
Definition YColor.h:63
YColor()
Definition YColor.h:50
bool isDefined() const
Definition YColor.h:78