Skip to content

Commit

Permalink
Move away from using GetProminentColor for ScrollableUserListView
Browse files Browse the repository at this point in the history
ProminentColors are eventually going away.  Resolve color using a
ColorId instead.

(cherry picked from commit 128b2d8)

Bug: b:291009599, b:291119801
Change-Id: I85241e4b01e8336399ba37752413b0d54a0e29b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4682876
Reviewed-by: Denis Kuznetsov <antrim@chromium.org>
Commit-Queue: Sean Kau <skau@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1171290}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4766139
Auto-Submit: Sean Kau <skau@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/branch-heads/5845@{#1324}
Cr-Branched-From: 5a5dff6-refs/heads/main@{#1160321}
  • Loading branch information
Sean Kau authored and Chromium LUCI CQ committed Aug 9, 2023
1 parent de8e74a commit 259556e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 3 additions & 4 deletions ash/login/ui/scrollable_users_list_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,9 @@ ScrollableUsersListView::GradientParams::BuildForStyle(LoginDisplayStyle style,
views::View* view) {
switch (style) {
case LoginDisplayStyle::kExtraSmall: {
SkColor dark_muted_color =
Shell::Get()->wallpaper_controller()->GetProminentColor(
color_utils::ColorProfile(color_utils::LumaRange::DARK,
color_utils::SaturationRange::MUTED));
SkColor dark_muted_color = view->GetColorProvider()->GetColor(
kColorAshLoginScrollableUserListBackground);

SkColor tint_color = color_utils::GetResultingPaintColor(
view->GetColorProvider()->GetColor(kColorAshShieldAndBase80),
SkColorSetA(dark_muted_color, SK_AlphaOPAQUE));
Expand Down
4 changes: 3 additions & 1 deletion ash/style/ash_color_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ namespace ash {
/* Color for the background of the phantom window */ \
E_CPONLY(kColorAshPhantomWindowBackgroundColor) \
/* Color for the stroke on the window header view */ \
E_CPONLY(kColorAshWindowHeaderStrokeColor)
E_CPONLY(kColorAshWindowHeaderStrokeColor) \
/* Color for the 6+ scrollable list view on the login screen */ \
E_CPONLY(kColorAshLoginScrollableUserListBackground)

#include "ui/color/color_id_macros.inc"

Expand Down
5 changes: 5 additions & 0 deletions ash/style/ash_color_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,11 @@ void AddAshColorMixer(ui::ColorProvider* provider,
mixer[kColorAshWindowHeaderStrokeColor] =
ui::SetAlpha(cros_tokens::kCrosRefNeutral0, kAlpha8);

// Color for the scrollable user view on login.
mixer[kColorAshLoginScrollableUserListBackground] = {
use_dark_color ? cros_tokens::kCrosRefNeutral20
: cros_tokens::kCrosRefNeutral80};

mixer[ui::kColorToggleButtonThumbOn] = {cros_tokens::kCrosSysOnPrimary};
mixer[ui::kColorToggleButtonThumbOff] = {cros_tokens::kCrosSysOnSecondary};
mixer[ui::kColorToggleButtonThumbOnDisabled] =
Expand Down

0 comments on commit 259556e

Please sign in to comment.