diff options
author | markt <markt> | 2007-01-02 06:31:23 (GMT) |
---|---|---|
committer | markt <markt> | 2007-01-02 06:31:23 (GMT) |
commit | aeac1b334441a348a411fc01a1568ece74b76a2f (patch) | |
tree | 0672ebc861858b09bf4373484eb36aa893919b77 /src | |
parent | 590b6c93d922a9940cb4c3d78d21509b289bd643 (diff) | |
download | fluxbox-aeac1b334441a348a411fc01a1568ece74b76a2f.zip fluxbox-aeac1b334441a348a411fc01a1568ece74b76a2f.tar.bz2 |
scaling color values so that they have the right intensity
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/Color.cc | 6 | ||||
-rw-r--r-- | src/FbTk/Texture.cc | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/FbTk/Color.cc b/src/FbTk/Color.cc index 8e5c8ef..263d34f 100644 --- a/src/FbTk/Color.cc +++ b/src/FbTk/Color.cc | |||
@@ -148,9 +148,9 @@ void Color::copy(const Color &col_copy) { | |||
148 | return; | 148 | return; |
149 | } | 149 | } |
150 | 150 | ||
151 | allocate(col_copy.red()*0xFF, | 151 | allocate(col_copy.red()*0x101, |
152 | col_copy.green()*0xFF, | 152 | col_copy.green()*0x101, |
153 | col_copy.blue()*0xFF, | 153 | col_copy.blue()*0x101, |
154 | col_copy.m_screen); | 154 | col_copy.m_screen); |
155 | 155 | ||
156 | } | 156 | } |
diff --git a/src/FbTk/Texture.cc b/src/FbTk/Texture.cc index 04f5eb7..a0a3b27 100644 --- a/src/FbTk/Texture.cc +++ b/src/FbTk/Texture.cc | |||
@@ -118,15 +118,15 @@ void Texture::calcHiLoColors(int screen_num) { | |||
118 | xcol.red = (unsigned int) (m_color.red() + | 118 | xcol.red = (unsigned int) (m_color.red() + |
119 | (m_color.red() >> 1)); | 119 | (m_color.red() >> 1)); |
120 | if (xcol.red >= 0xff) xcol.red = 0xffff; | 120 | if (xcol.red >= 0xff) xcol.red = 0xffff; |
121 | else xcol.red *= 0xff; | 121 | else xcol.red *= 0x101; |
122 | xcol.green = (unsigned int) (m_color.green() + | 122 | xcol.green = (unsigned int) (m_color.green() + |
123 | (m_color.green() >> 1)); | 123 | (m_color.green() >> 1)); |
124 | if (xcol.green >= 0xff) xcol.green = 0xffff; | 124 | if (xcol.green >= 0xff) xcol.green = 0xffff; |
125 | else xcol.green *= 0xff; | 125 | else xcol.green *= 0x101; |
126 | xcol.blue = (unsigned int) (m_color.blue() + | 126 | xcol.blue = (unsigned int) (m_color.blue() + |
127 | (m_color.blue() >> 1)); | 127 | (m_color.blue() >> 1)); |
128 | if (xcol.blue >= 0xff) xcol.blue = 0xffff; | 128 | if (xcol.blue >= 0xff) xcol.blue = 0xffff; |
129 | else xcol.blue *= 0xff; | 129 | else xcol.blue *= 0x101; |
130 | 130 | ||
131 | if (! XAllocColor(disp, colm, &xcol)) | 131 | if (! XAllocColor(disp, colm, &xcol)) |
132 | xcol.pixel = 0; | 132 | xcol.pixel = 0; |
@@ -135,13 +135,13 @@ void Texture::calcHiLoColors(int screen_num) { | |||
135 | 135 | ||
136 | xcol.red = | 136 | xcol.red = |
137 | (unsigned int) ((m_color.red() >> 2) + | 137 | (unsigned int) ((m_color.red() >> 2) + |
138 | (m_color.red() >> 1)) * 0xff; | 138 | (m_color.red() >> 1)) * 0x101; |
139 | xcol.green = | 139 | xcol.green = |
140 | (unsigned int) ((m_color.green() >> 2) + | 140 | (unsigned int) ((m_color.green() >> 2) + |
141 | (m_color.green() >> 1)) * 0xff; | 141 | (m_color.green() >> 1)) * 0x101; |
142 | xcol.blue = | 142 | xcol.blue = |
143 | (unsigned int) ((m_color.blue() >> 2) + | 143 | (unsigned int) ((m_color.blue() >> 2) + |
144 | (m_color.blue() >> 1)) * 0xff; | 144 | (m_color.blue() >> 1)) * 0x101; |
145 | 145 | ||
146 | if (! XAllocColor(disp, colm, &xcol)) | 146 | if (! XAllocColor(disp, colm, &xcol)) |
147 | xcol.pixel = 0; | 147 | xcol.pixel = 0; |