Skip to content

Commit

Permalink
Update location/omnibox color
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Nov 16, 2020
1 parent c05d220 commit c12d880
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions browser/themes/brave_theme_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,24 @@ const SkColor kDarkOmniboxText = SkColorSetRGB(0xff, 0xff, 0xff);
const SkColor kLightOmniboxText = SkColorSetRGB(0x42, 0x42, 0x42);

// Location bar colors
const SkColor kPrivateLocationBarBgBase = SkColorSetRGB(0x1b, 0x0e, 0x2c);
const SkColor kPrivateLocationBarBgBase = SkColorSetRGB(0x0B, 0x07, 0x24);
const SkColor kDarkLocationBarBgBase = SkColorSetRGB(0x18, 0x1A, 0x21);

SkColor GetLocationBarBackground(bool dark, bool priv, bool hover) {
if (priv) {
return color_utils::HSLShift(kPrivateLocationBarBgBase,
{-1, -1, hover ? 0.54 : 0.52});
return hover ? color_utils::HSLShift(kPrivateLocationBarBgBase,
{-1, -1, 0.54})
: kPrivateLocationBarBgBase;
}

return dark ? (hover ? SkColorSetRGB(0x44, 0x44, 0x44)
: SkColorSetRGB(0x22, 0x22, 0x22))
: (hover ? color_utils::AlphaBlend(
SK_ColorWHITE,
SkColorSetRGB(0xf3, 0xf3, 0xf3), 0.7f)
: SK_ColorWHITE);
if (dark) {
return hover ? SkColorSetRGB(0x44, 0x44, 0x44)
: kDarkLocationBarBgBase;
}

return hover ? color_utils::AlphaBlend(SK_ColorWHITE,
SkColorSetRGB(0xf3, 0xf3, 0xf3), 0.7f)
: SK_ColorWHITE;
}

// Omnibox result bg colors
Expand All @@ -55,11 +59,13 @@ SkColor GetOmniboxResultBackground(int id, bool dark, bool priv) {

SkColor color;
if (priv) {
color = color_utils::HSLShift(kPrivateLocationBarBgBase,
{-1, -1, high_contrast ? 0.45 : 0.56});
color = high_contrast ? color_utils::HSLShift(kPrivateLocationBarBgBase,
{-1, -1, 0.45})
: kPrivateLocationBarBgBase;
} else if (dark) {
color = high_contrast ? gfx::kGoogleGrey900 : kDarkLocationBarBgBase;
} else {
color = dark ? (high_contrast ? gfx::kGoogleGrey900 : gfx::kGoogleGrey800)
: SK_ColorWHITE;
color = SK_ColorWHITE;
}
return color_utils::BlendTowardMaxContrast(
color,
Expand Down

0 comments on commit c12d880

Please sign in to comment.