From aeac1b334441a348a411fc01a1568ece74b76a2f Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 2 Jan 2007 06:31:23 +0000 Subject: scaling color values so that they have the right intensity --- src/FbTk/Color.cc | 6 +++--- 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) { return; } - allocate(col_copy.red()*0xFF, - col_copy.green()*0xFF, - col_copy.blue()*0xFF, + allocate(col_copy.red()*0x101, + col_copy.green()*0x101, + col_copy.blue()*0x101, col_copy.m_screen); } 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) { xcol.red = (unsigned int) (m_color.red() + (m_color.red() >> 1)); if (xcol.red >= 0xff) xcol.red = 0xffff; - else xcol.red *= 0xff; + else xcol.red *= 0x101; xcol.green = (unsigned int) (m_color.green() + (m_color.green() >> 1)); if (xcol.green >= 0xff) xcol.green = 0xffff; - else xcol.green *= 0xff; + else xcol.green *= 0x101; xcol.blue = (unsigned int) (m_color.blue() + (m_color.blue() >> 1)); if (xcol.blue >= 0xff) xcol.blue = 0xffff; - else xcol.blue *= 0xff; + else xcol.blue *= 0x101; if (! XAllocColor(disp, colm, &xcol)) xcol.pixel = 0; @@ -135,13 +135,13 @@ void Texture::calcHiLoColors(int screen_num) { xcol.red = (unsigned int) ((m_color.red() >> 2) + - (m_color.red() >> 1)) * 0xff; + (m_color.red() >> 1)) * 0x101; xcol.green = (unsigned int) ((m_color.green() >> 2) + - (m_color.green() >> 1)) * 0xff; + (m_color.green() >> 1)) * 0x101; xcol.blue = (unsigned int) ((m_color.blue() >> 2) + - (m_color.blue() >> 1)) * 0xff; + (m_color.blue() >> 1)) * 0x101; if (! XAllocColor(disp, colm, &xcol)) xcol.pixel = 0; -- cgit v0.11.2