Commit 1d5e2acc authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

omnibox: tweak high contrast scheme for URL readability

The URL's contrast on the selected grey background is too low. This change
increases the brightness of the URL and darkens the background, pushing the
contrast ratio over threshold.

Bug: 870290
Change-Id: I30f40bcf85b283ee1ca6ddf82dd20e3dbeb9d91f
Reviewed-on: https://chromium-review.googlesource.com/1163731Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581203}
parent ab19f55c
...@@ -249,8 +249,12 @@ SkColor GetOmniboxColor(OmniboxPart part, ...@@ -249,8 +249,12 @@ SkColor GetOmniboxColor(OmniboxPart part,
// The spec calls for transparent black (or white) overlays for hover (8%) // The spec calls for transparent black (or white) overlays for hover (8%)
// and select (6%), which can overlap (for 14%). Pre-blend these with the // and select (6%), which can overlap (for 14%). Pre-blend these with the
// background for the best text AA result. // background for the best text AA result.
// High contrast mode needs a darker base - Grey 800 with 14% white
// overlaid on it (see below) is hard to produce good contrast ratios
// against with colors other than white.
return color_utils::BlendTowardOppositeLuma( return color_utils::BlendTowardOppositeLuma(
dark ? gfx::kGoogleGrey800 : SK_ColorWHITE, dark ? (high_contrast ? gfx::kGoogleGrey900 : gfx::kGoogleGrey800)
: SK_ColorWHITE,
gfx::ToRoundedInt(GetOmniboxStateAlpha(state) * 0xff)); gfx::ToRoundedInt(GetOmniboxStateAlpha(state) * 0xff));
case OmniboxPart::LOCATION_BAR_TEXT_DEFAULT: case OmniboxPart::LOCATION_BAR_TEXT_DEFAULT:
case OmniboxPart::RESULTS_TEXT_DEFAULT: case OmniboxPart::RESULTS_TEXT_DEFAULT:
...@@ -270,6 +274,8 @@ SkColor GetOmniboxColor(OmniboxPart part, ...@@ -270,6 +274,8 @@ SkColor GetOmniboxColor(OmniboxPart part,
case OmniboxPart::RESULTS_TEXT_POSITIVE: case OmniboxPart::RESULTS_TEXT_POSITIVE:
return dark ? gfx::kGoogleGreenDark600 : gfx::kGoogleGreen600; return dark ? gfx::kGoogleGreenDark600 : gfx::kGoogleGreen600;
case OmniboxPart::RESULTS_TEXT_URL: case OmniboxPart::RESULTS_TEXT_URL:
if (high_contrast)
return dark ? gfx::kGoogleBlue300 : gfx::kGoogleBlue700;
return dark ? gfx::kGoogleBlueDark600 : gfx::kGoogleBlue600; return dark ? gfx::kGoogleBlueDark600 : gfx::kGoogleBlue600;
case OmniboxPart::LOCATION_BAR_BUBBLE_OUTLINE: case OmniboxPart::LOCATION_BAR_BUBBLE_OUTLINE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment