зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1379266 - Tweak -moz-win-accentcolortext formula to better match native title bars. r=jimm
MozReview-Commit-ID: 9unrhFI3sWh --HG-- extra : rebase_source : 096198d640ee39c87d8495fe6e6e872544aa6478
This commit is contained in:
Родитель
9970f27f54
Коммит
f605598222
|
@ -840,11 +840,11 @@ nsLookAndFeel::GetAccentColorText(nscolor& aColor)
|
|||
// here based on the luminance of the accent color with a threshhold
|
||||
// value that seem consistent with what Windows does.
|
||||
|
||||
float luminance = 0.2125f * NS_GET_R(accentColor) +
|
||||
0.7154f * NS_GET_G(accentColor) +
|
||||
0.0721f * NS_GET_B(accentColor);
|
||||
float luminance = (NS_GET_R(accentColor) * 2 +
|
||||
NS_GET_G(accentColor) * 5 +
|
||||
NS_GET_B(accentColor)) / 8;
|
||||
|
||||
aColor = (luminance <= 110) ? NS_RGB(255, 255, 255) : NS_RGB(0, 0, 0);
|
||||
aColor = (luminance <= 128) ? NS_RGB(255, 255, 255) : NS_RGB(0, 0, 0);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче