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

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


Sorry, here is the patch ; )

On Sat, May 31, 2008 at 12:41 AM, Percy Camilo Triveño Aucahuasi <
orgyforever at gmail.com> wrote:

> 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/78594643/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: valuelistwidget.diff
Type: text/x-diff
Size: 1488 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20080531/78594643/attachment.bin 


More information about the kde-games-devel mailing list