[Kde-games-devel] [KSudoku] Background color problem

Percy Camilo Triveño Aucahuasi orgyforever at gmail.com
Sat May 31 07:41:58 CEST 2008


Hi all, when I change the color style of my desktop, then the simbols in
KSudoku dissapears, check this screenshots:

Default look:
http://www.imagehosting.com/show.php/1769977_whitewndcolorsettings.png.html

Problem:
http://www.imagehosting.com/show.php/1769975_blackwndcolorsettings.png.html


This patch solved that problem. This is the screenshot with the patch:

http://www.imagehosting.com/show.php/1769976_solved.png.html

In the patch I'm using this lines to obtain the base color of the window:

//********************************
KColorScheme systemColorScheme(QPalette::Active);
QColor baseWndColor =
systemColorScheme.background(KColorScheme::NormalBackground).color();
int luminance = 0.2126*baseWndColor.red() + 0.7152*baseWndColor.green() +
0.0722*baseWndColor.blue();
if (luminance > (255 / 2.0))
// set the color font/brush to black
else
// set the color font/brush to white
//********************************

Is that ok? or there is a better way?

If it's ok ... may I commit? ; )

Cheers,
Percy

pd: btw I already reported: http://bugs.kde.org/show_bug.cgi?id=162832
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-games-devel/attachments/20080531/484c9c37/attachment.html 


More information about the kde-games-devel mailing list