diff options
author | Max Horn | 2007-02-10 18:09:13 +0000 |
---|---|---|
committer | Max Horn | 2007-02-10 18:09:13 +0000 |
commit | a14e90478c3e45a2fdc8eaf9edb975cf42fc5742 (patch) | |
tree | 36dfa4ddff2b3b67382f33c5e3031be39dcd4bd8 /gui/ThemeModern.cpp | |
parent | 9dbf7d271b081bec65e33f6c229447adeb39ec01 (diff) | |
download | scummvm-rg350-a14e90478c3e45a2fdc8eaf9edb975cf42fc5742.tar.gz scummvm-rg350-a14e90478c3e45a2fdc8eaf9edb975cf42fc5742.tar.bz2 scummvm-rg350-a14e90478c3e45a2fdc8eaf9edb975cf42fc5742.zip |
Added small note to ThemeModern::calcLuminance
svn-id: r25472
Diffstat (limited to 'gui/ThemeModern.cpp')
-rw-r--r-- | gui/ThemeModern.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gui/ThemeModern.cpp b/gui/ThemeModern.cpp index 9b7df9ed59..8452c8a37d 100644 --- a/gui/ThemeModern.cpp +++ b/gui/ThemeModern.cpp @@ -1454,6 +1454,10 @@ OverlayColor ThemeModern::calcLuminance(OverlayColor col) { uint8 r, g, b; _system->colorToRGB(col, r, g, b); + // A better (but slower) formula to calculate the luminance would be: + //uint lum = (byte)((0.299 * r + 0.587 * g + 0.114 * b) + 0.5); + // Note that the approximation below will only produce values between + // (and including) 0 and 221. uint lum = (r >> 2) + (g >> 1) + (b >> 3); return _system->RGBToColor(lum, lum, lum); |