diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 21:59:38 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 21:59:38 +0000 |
commit | 9ddb1e9d3c36bcd5af1a96cd0452fcb3e3c36dc5 (patch) | |
tree | 16c72480277f3c7ecabcc20fe0a6081db3e887b2 /chrome/browser/views/autocomplete | |
parent | 9d7eed94008640d64ce3e6108829509eaa52c4b1 (diff) | |
download | chromium_src-9ddb1e9d3c36bcd5af1a96cd0452fcb3e3c36dc5.zip chromium_src-9ddb1e9d3c36bcd5af1a96cd0452fcb3e3c36dc5.tar.gz chromium_src-9ddb1e9d3c36bcd5af1a96cd0452fcb3e3c36dc5.tar.bz2 |
Simplify life for people trying to pick a "readable" foreground color by not requiring them to provide two choices. This also speeds the call up a tiny bit by not calculating the background luminance twice.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/220029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27138 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/autocomplete')
-rw-r--r-- | chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc index 7efee67..ea1908e 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc @@ -67,13 +67,11 @@ SkColor GetColor(ResultViewState state, ColorKind kind) { color_utils::AlphaBlend(colors[SELECTED][BACKGROUND], colors[NORMAL][BACKGROUND], 64); colors[HOVERED][TEXT] = colors[NORMAL][TEXT]; - const SkColor kDarkURL = SkColorSetRGB(0, 128, 0); - const SkColor kLightURL = SkColorSetRGB(128, 255, 128); for (int i = 0; i < NUM_STATES; ++i) { colors[i][DIMMED_TEXT] = color_utils::AlphaBlend(colors[i][TEXT], colors[i][BACKGROUND], 128); - colors[i][URL] = color_utils::PickMoreReadableColor(kDarkURL, kLightURL, - colors[i][BACKGROUND]); + colors[i][URL] = color_utils::GetReadableColor(SkColorSetRGB(0, 128, 0), + colors[i][BACKGROUND]); } initialized = true; } |