-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[color] Add tab strip material color mixer
This CL adds an initial color mixer for tab strip colors. Follow up work will be needed to correctly address various state colors. Bug: 1399942 Change-Id: Ief283791c26422d383befb137ddb44356ae574e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4347396 Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org> Reviewed-by: Allen Bauer <kylixrd@chromium.org> Cr-Commit-Position: refs/heads/main@{#1118527}
- Loading branch information
Thomas Lukaszewicz
authored and
Chromium LUCI CQ
committed
Mar 17, 2023
1 parent
b34759e
commit 179adb9
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/browser/ui/color/material_tab_strip_color_mixer.h" | ||
|
||
#include "chrome/browser/ui/color/chrome_color_id.h" | ||
#include "ui/color/color_id.h" | ||
#include "ui/color/color_mixer.h" | ||
#include "ui/color/color_provider.h" | ||
#include "ui/color/color_recipe.h" | ||
|
||
void AddMaterialTabStripColorMixer(ui::ColorProvider* provider, | ||
const ui::ColorProviderManager::Key& key) { | ||
ui::ColorMixer& mixer = provider->AddMixer(); | ||
|
||
// TODO(crbug.com/1399942): Validate final mappings for Gm3 color. | ||
mixer[kColorTabBackgroundActiveFrameActive] = {ui::kColorSysBase}; | ||
mixer[kColorTabBackgroundActiveFrameInactive] = { | ||
kColorTabBackgroundActiveFrameActive}; | ||
mixer[kColorTabBackgroundInactiveFrameActive] = {ui::kColorSysHeader}; | ||
mixer[kColorTabBackgroundInactiveFrameInactive] = { | ||
ui::kColorSysHeaderInactive}; | ||
|
||
mixer[kColorTabForegroundActiveFrameActive] = {ui::kColorSysOnSurface}; | ||
mixer[kColorTabForegroundActiveFrameInactive] = { | ||
kColorTabForegroundActiveFrameActive}; | ||
mixer[kColorTabForegroundInactiveFrameActive] = { | ||
ui::kColorSysOnSurfaceSecondary}; | ||
mixer[kColorTabForegroundInactiveFrameInactive] = { | ||
kColorTabForegroundInactiveFrameActive}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROME_BROWSER_UI_COLOR_MATERIAL_TAB_STRIP_COLOR_MIXER_H_ | ||
#define CHROME_BROWSER_UI_COLOR_MATERIAL_TAB_STRIP_COLOR_MIXER_H_ | ||
|
||
#include "ui/color/color_provider_manager.h" | ||
|
||
namespace ui { | ||
class ColorProvider; | ||
} | ||
|
||
// Adds a color mixer that contains recipes for tab strip colors to `provider` | ||
// with |key|. | ||
void AddMaterialTabStripColorMixer(ui::ColorProvider* provider, | ||
const ui::ColorProviderManager::Key& key); | ||
|
||
#endif // CHROME_BROWSER_UI_COLOR_MATERIAL_TAB_STRIP_COLOR_MIXER_H_ |