diff options
-rw-r--r-- | src/FbTk/Color.cc | 8 | ||||
-rw-r--r-- | src/FbTk/Color.hh | 17 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/FbTk/Color.cc b/src/FbTk/Color.cc index 44cd1bb..0cfa481 100644 --- a/src/FbTk/Color.cc +++ b/src/FbTk/Color.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: Color.cc,v 1.3 2002/12/01 13:42:14 rathnor Exp $ | 22 | // $Id: Color.cc,v 1.4 2003/02/23 01:09:20 fluxgen Exp $ |
23 | 23 | ||
24 | #include "Color.hh" | 24 | #include "Color.hh" |
25 | 25 | ||
@@ -50,7 +50,7 @@ Color::Color(const Color &col_copy) { | |||
50 | copy(col_copy); | 50 | copy(col_copy); |
51 | } | 51 | } |
52 | 52 | ||
53 | Color::Color(unsigned char red, unsigned char green, unsigned char blue, int screen): | 53 | Color::Color(unsigned short red, unsigned short green, unsigned short blue, int screen): |
54 | m_red(red), m_green(green), m_blue(blue), | 54 | m_red(red), m_green(green), m_blue(blue), |
55 | m_pixel(0), m_allocated(false), | 55 | m_pixel(0), m_allocated(false), |
56 | m_screen(screen) { | 56 | m_screen(screen) { |
@@ -138,7 +138,7 @@ void Color::copy(const Color &col_copy) { | |||
138 | 138 | ||
139 | } | 139 | } |
140 | 140 | ||
141 | void Color::allocate(unsigned char red, unsigned char green, unsigned char blue, int screen) { | 141 | void Color::allocate(unsigned short red, unsigned short green, unsigned short blue, int screen) { |
142 | 142 | ||
143 | Display *disp = App::instance()->display(); | 143 | Display *disp = App::instance()->display(); |
144 | XColor color; | 144 | XColor color; |
@@ -161,7 +161,7 @@ void Color::allocate(unsigned char red, unsigned char green, unsigned char blue, | |||
161 | m_screen = screen; | 161 | m_screen = screen; |
162 | } | 162 | } |
163 | 163 | ||
164 | void Color::setRGB(unsigned char red, unsigned char green, unsigned char blue) { | 164 | void Color::setRGB(unsigned short red, unsigned short green, unsigned short blue) { |
165 | m_red = red; | 165 | m_red = red; |
166 | m_green = green; | 166 | m_green = green; |
167 | m_blue = blue; | 167 | m_blue = blue; |
diff --git a/src/FbTk/Color.hh b/src/FbTk/Color.hh index d96db8d..e54512c 100644 --- a/src/FbTk/Color.hh +++ b/src/FbTk/Color.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Color.hh,v 1.2 2002/12/01 13:42:14 rathnor Exp $ | 25 | // $Id: Color.hh,v 1.3 2003/02/23 01:09:02 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef FBTK_COLOR_HH | 27 | #ifndef FBTK_COLOR_HH |
28 | #define FBTK_COLOR_HH | 28 | #define FBTK_COLOR_HH |
@@ -38,7 +38,7 @@ public: | |||
38 | Color(); | 38 | Color(); |
39 | explicit Color(unsigned long pixel); | 39 | explicit Color(unsigned long pixel); |
40 | Color(const Color &col_copy); | 40 | Color(const Color &col_copy); |
41 | Color(unsigned char red, unsigned char green, unsigned char blue, int screen); | 41 | Color(unsigned short red, unsigned short green, unsigned short blue, int screen); |
42 | Color(const char *color_string, int screen); | 42 | Color(const char *color_string, int screen); |
43 | ~Color(); | 43 | ~Color(); |
44 | 44 | ||
@@ -49,20 +49,21 @@ public: | |||
49 | //Color &operator = (const Color &col_copy); | 49 | //Color &operator = (const Color &col_copy); |
50 | 50 | ||
51 | bool isAllocated() const { return m_allocated; } | 51 | bool isAllocated() const { return m_allocated; } |
52 | unsigned char red() const { return m_red; } | 52 | unsigned short red() const { return m_red; } |
53 | unsigned char green() const { return m_green; } | 53 | unsigned short green() const { return m_green; } |
54 | unsigned char blue() const { return m_blue; } | 54 | unsigned short blue() const { return m_blue; } |
55 | unsigned long pixel() const { return m_pixel; } | 55 | unsigned long pixel() const { return m_pixel; } |
56 | 56 | ||
57 | private: | 57 | private: |
58 | void free(); | 58 | void free(); |
59 | void copy(const Color &col); | 59 | void copy(const Color &col); |
60 | void allocate(unsigned char red, unsigned char green, unsigned char blue, int screen); | 60 | void allocate(unsigned short red, unsigned short green, |
61 | unsigned short blue, int screen); | ||
61 | inline void setAllocated(bool a) { m_allocated = a; } | 62 | inline void setAllocated(bool a) { m_allocated = a; } |
62 | void setRGB(unsigned char red, unsigned char green, unsigned char blue); | 63 | void setRGB(unsigned short red, unsigned short green, unsigned short blue); |
63 | 64 | ||
64 | 65 | ||
65 | unsigned char m_red, m_green, m_blue; | 66 | unsigned short m_red, m_green, m_blue; |
66 | unsigned long m_pixel; | 67 | unsigned long m_pixel; |
67 | bool m_allocated; | 68 | bool m_allocated; |
68 | int m_screen; | 69 | int m_screen; |