aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Texture.cc21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/FbTk/Texture.cc b/src/FbTk/Texture.cc
index 2fcd915..caada06 100644
--- a/src/FbTk/Texture.cc
+++ b/src/FbTk/Texture.cc
@@ -114,16 +114,13 @@ void Texture::calcHiLoColors(int screen_num) {
114 XColor xcol; 114 XColor xcol;
115 Colormap colm = DefaultColormap(disp, screen_num); 115 Colormap colm = DefaultColormap(disp, screen_num);
116 116
117 xcol.red = (unsigned int) (m_color.red() + 117 xcol.red = (unsigned int) (m_color.red() + (m_color.red() >> 1));
118 (m_color.red() >> 1));
119 if (xcol.red >= 0xff) xcol.red = 0xffff; 118 if (xcol.red >= 0xff) xcol.red = 0xffff;
120 else xcol.red *= 0x101; 119 else xcol.red *= 0x101;
121 xcol.green = (unsigned int) (m_color.green() + 120 xcol.green = (unsigned int) (m_color.green() + (m_color.green() >> 1));
122 (m_color.green() >> 1));
123 if (xcol.green >= 0xff) xcol.green = 0xffff; 121 if (xcol.green >= 0xff) xcol.green = 0xffff;
124 else xcol.green *= 0x101; 122 else xcol.green *= 0x101;
125 xcol.blue = (unsigned int) (m_color.blue() + 123 xcol.blue = (unsigned int) (m_color.blue() + (m_color.blue() >> 1));
126 (m_color.blue() >> 1));
127 if (xcol.blue >= 0xff) xcol.blue = 0xffff; 124 if (xcol.blue >= 0xff) xcol.blue = 0xffff;
128 else xcol.blue *= 0x101; 125 else xcol.blue *= 0x101;
129 126
@@ -132,15 +129,9 @@ void Texture::calcHiLoColors(int screen_num) {
132 129
133 m_hicolor.setPixel(xcol.pixel); 130 m_hicolor.setPixel(xcol.pixel);
134 131
135 xcol.red = 132 xcol.red = (unsigned int) ((m_color.red() >> 2) + (m_color.red() >> 1)) * 0x101;
136 (unsigned int) ((m_color.red() >> 2) + 133 xcol.green = (unsigned int) ((m_color.green() >> 2) + (m_color.green() >> 1)) * 0x101;
137 (m_color.red() >> 1)) * 0x101; 134 xcol.blue = (unsigned int) ((m_color.blue() >> 2) + (m_color.blue() >> 1)) * 0x101;
138 xcol.green =
139 (unsigned int) ((m_color.green() >> 2) +
140 (m_color.green() >> 1)) * 0x101;
141 xcol.blue =
142 (unsigned int) ((m_color.blue() >> 2) +
143 (m_color.blue() >> 1)) * 0x101;
144 135
145 if (! XAllocColor(disp, colm, &xcol)) 136 if (! XAllocColor(disp, colm, &xcol))
146 xcol.pixel = 0; 137 xcol.pixel = 0;