Bug 162832

Summary: White/Black window colors (makes a bug)
Product: [Applications] ksudoku Reporter: Percy Camilo Triveño Aucahuasi <percy.camilo.ta>
Component: generalAssignee: Johannes.Bergmeier
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version: 0.5   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Image with the default white background
Image with the black background

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.