From f16ed908beb203e13d7a9ac785c03e698f755ad4 Mon Sep 17 00:00:00 2001 From: stippi Date: Thu, 25 Feb 2010 12:49:38 +0000 Subject: [PATCH] What the heck... use the correct weighting for calculating the average grey. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@213 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/IconButton.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/webpositive/IconButton.cpp b/src/apps/webpositive/IconButton.cpp index 3ccf1c13b3..5cd2ede604 100644 --- a/src/apps/webpositive/IconButton.cpp +++ b/src/apps/webpositive/IconButton.cpp @@ -821,8 +821,9 @@ IconButton::_MakeBitmaps(const BBitmap* bitmap) cBits[nOffset + 3] = fBits[fOffset + 3]; // disabled bits have less opacity - uint8 grey = ((uint16)nBits[nOffset + 0] + nBits[nOffset + 1] - + nBits[nOffset + 2]) / 3; + uint8 grey = ((uint16)nBits[nOffset + 0] * 10 + + nBits[nOffset + 1] * 60 + + nBits[nOffset + 2] * 30) / 100; float dist = (nBits[nOffset + 0] - grey) * 0.3; dBits[nOffset + 0] = (uint8)(grey + dist); dist = (nBits[nOffset + 1] - grey) * 0.3;