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/location_bar_view.cc | |
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/location_bar_view.cc')
-rw-r--r-- | chrome/browser/views/location_bar_view.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index 4becb2f..0e3e104 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -238,27 +238,15 @@ SkColor LocationBarView::GetColor(bool is_secure, ColorKind kind) { colors[SECURE][DEEMPHASIZED_TEXT] = color_utils::AlphaBlend(colors[SECURE][TEXT], colors[SECURE][BACKGROUND], 128); - const SkColor kDarkNotSecureText = SkColorSetRGB(200, 0, 0); - const SkColor kLightNotSecureText = SkColorSetRGB(255, 55, 55); - colors[NOT_SECURE][SECURITY_TEXT] = - color_utils::PickMoreReadableColor(kDarkNotSecureText, - kLightNotSecureText, - colors[NOT_SECURE][BACKGROUND]); + colors[NOT_SECURE][SECURITY_TEXT] = color_utils::GetReadableColor( + SkColorSetRGB(200, 0, 0), colors[NOT_SECURE][BACKGROUND]); colors[SECURE][SECURITY_TEXT] = SkColorSetRGB(0, 150, 20); colors[NOT_SECURE][SECURITY_INFO_BUBBLE_TEXT] = colors[NOT_SECURE][SECURITY_TEXT]; - const SkColor kDarkSecureInfoBubbleText = SkColorSetRGB(0, 153, 51); - const SkColor kLightSecureInfoBubbleText = SkColorSetRGB(102, 255, 152); - colors[SECURE][SECURITY_INFO_BUBBLE_TEXT] = - color_utils::PickMoreReadableColor(kDarkSecureInfoBubbleText, - kLightSecureInfoBubbleText, - colors[NOT_SECURE][BACKGROUND]); - const SkColor kDarkSchemeStrikeout = SkColorSetRGB(210, 0, 0); - const SkColor kLightSchemeStrikeout = SkColorSetRGB(255, 45, 45); - colors[NOT_SECURE][SCHEME_STRIKEOUT] = - color_utils::PickMoreReadableColor(kDarkSchemeStrikeout, - kLightSchemeStrikeout, - colors[NOT_SECURE][BACKGROUND]); + colors[SECURE][SECURITY_INFO_BUBBLE_TEXT] = color_utils::GetReadableColor( + SkColorSetRGB(0, 153, 51), colors[NOT_SECURE][BACKGROUND]); + colors[NOT_SECURE][SCHEME_STRIKEOUT] = color_utils::GetReadableColor( + SkColorSetRGB(210, 0, 0), colors[NOT_SECURE][BACKGROUND]); colors[SECURE][SCHEME_STRIKEOUT] = 0; // Unused initialized = true; } |