Bug 162832 - White/Black window colors (makes a bug)
Summary: White/Black window colors (makes a bug)
Status: RESOLVED WORKSFORME
Alias: None
Product: ksudoku
Classification: Applications
Component: general (show other bugs)
Version: 0.5
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Johannes.Bergmeier
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-29 21:42 UTC by Percy Camilo Triveño Aucahuasi
Modified: 2008-06-01 02:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Image with the default white background (295.42 KB, image/png)
2008-05-29 21:48 UTC, Percy Camilo Triveño Aucahuasi
Details
Image with the black background (363.67 KB, image/png)
2008-05-29 21:49 UTC, Percy Camilo Triveño Aucahuasi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Percy Camilo Triveño Aucahuasi 2008-05-29 21:42:04 UTC
Version:           0.5 (using Devel)
Installed from:    Compiled sources
Compiler:          gcc (GCC) 4.2.4 20080512 (prerelease) 
OS:                Linux

When I set the default color style of the windows to a black one, then the numbers that are in the toolbar disapear becouse their fonts are black too.

I'm attaching some screenshots. And a posible solution for this issue, if ksudoku can know the color of the base window then it could be set the color of the fonts to the contrast color of the background. I hope that code can help. BTW great job with this game, thanks ;)

********
KColorScheme systemColorScheme(QPalette::Active);

// this is the background color of the window
QColor baseWndColor = systemColorScheme.background(KColorScheme::NormalBackground).color();

// we obtain the luminance
int luminance = 0.2126*baseWndColor.red() + 0.7152*baseWndColor.green() + 0.0722*baseWndColor.blue();

//we choose the color font to be
//white or black according to the luminence of the background
if (luminance > (255 / 2.0))
{
// set the color of the font to black
}
else
{
// set the color of the font to white
}

********
Comment 1 Percy Camilo Triveño Aucahuasi 2008-05-29 21:48:37 UTC
Created attachment 24997 [details]
Image with the default white background
Comment 2 Percy Camilo Triveño Aucahuasi 2008-05-29 21:49:55 UTC
Created attachment 24998 [details]
Image with the black background
Comment 3 Percy Camilo Triveño Aucahuasi 2008-06-01 02:04:33 UTC
SVN commit 815034 by aucahuasi:

CCBUG: 162832
This patch solve the background issue.

 M  +15 -0     valuelistwidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=815034
Comment 4 Percy Camilo Triveño Aucahuasi 2008-06-01 02:11:23 UTC
I'm already commit the patch ; ) the bug is solved.