mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-10 00:41:19 +12:00
Fix various colour values for dark themes (#439)
This commit is contained in:
parent
94b179ef5a
commit
2842615edb
5 changed files with 28 additions and 17 deletions
|
@ -22,5 +22,16 @@ namespace wxHelper
|
|||
return wxString::FromUTF8(str.data(), str.size());
|
||||
}
|
||||
|
||||
inline wxColour CalculateAccentColour(const wxColour& bgColour)
|
||||
{
|
||||
wxColour bgColourSecondary;
|
||||
const uint32 bgLightness = (bgColour.GetRed() + bgColour.GetGreen() + bgColour.GetBlue()) / 3;
|
||||
const bool isDarkTheme = bgLightness < 128;
|
||||
bgColourSecondary = bgColour.ChangeLightness(isDarkTheme ? 110 : 90); // color for even rows
|
||||
// for very light themes we'll use a blue tint to match the older Windows Cemu look
|
||||
if (bgLightness > 250)
|
||||
bgColourSecondary = wxColour(bgColour.Red() - 13, bgColour.Green() - 6, bgColour.Blue() - 2);
|
||||
return bgColourSecondary;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue