Commit 8cd3c1a4 authored by Thomas Lukaszewicz's avatar Thomas Lukaszewicz Committed by Commit Bot

Removed the need to specify input/result color in transforms.

Removed the need to specify FromInputColor/FromOutputColor in
ColorTransforms. All references to color are now taken to mean
FromOutputColor as we do not currently have a use for FromInputColor
in the code. This significantly reduces the verbosity of recipe
code.

Bug: 1887666
Change-Id: I1fa3816f738e5479eb24ae30b86e6851792913b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918640
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715703}
parent 5a68c9c5
......@@ -18,49 +18,46 @@ void AddOmniboxColorMixer(ui::ColorProvider* provider, bool high_contrast) {
high_contrast ? 6.0f : color_utils::kMinimumReadableContrastRatio;
// Omnibox background colors.
mixer[kColorOmniboxBackground] = ui::GetResultingPaintColor(
ui::FromTransformInput(), ui::FromInputColor(kColorToolbar));
mixer[kColorOmniboxBackgroundHovered] = ui::BlendTowardMaxContrast(
ui::FromResultColor(kColorOmniboxBackground), 0x0A);
mixer[kColorOmniboxBackground] =
ui::GetResultingPaintColor(ui::FromTransformInput(), kColorToolbar);
mixer[kColorOmniboxBackgroundHovered] =
ui::BlendTowardMaxContrast(kColorOmniboxBackground, 0x0A);
// Omnibox text colors.
mixer[kColorOmniboxText] = ui::GetResultingPaintColor(
ui::FromTransformInput(), ui::FromResultColor(kColorOmniboxBackground));
ui::FromTransformInput(), kColorOmniboxBackground);
{
auto& selected_text = mixer[kColorOmniboxResultsTextSelected];
selected_text = ui::FromResultColor(kColorOmniboxText);
selected_text = {kColorOmniboxText};
if (high_contrast)
selected_text += ui::ContrastInvert(ui::FromTransformInput());
}
mixer[kColorOmniboxSelectedKeyword] = ui::SelectBasedOnDarkInput(
ui::FromResultColor(kColorOmniboxBackground), gfx::kGoogleGrey100,
ui::FromResultColor(kColorOmniboxResultsUrl));
kColorOmniboxBackground, gfx::kGoogleGrey100, kColorOmniboxResultsUrl);
// Bubble outline colors.
mixer[kColorOmniboxBubbleOutline] = ui::SelectBasedOnDarkInput(
ui::FromResultColor(kColorOmniboxBackground), gfx::kGoogleGrey100,
SkColorSetA(gfx::kGoogleGrey900, 0x24));
mixer[kColorOmniboxBubbleOutlineExperimentalKeywordMode] =
ui::FromResultColor(kColorOmniboxSelectedKeyword);
mixer[kColorOmniboxBubbleOutline] =
ui::SelectBasedOnDarkInput(kColorOmniboxBackground, gfx::kGoogleGrey100,
SkColorSetA(gfx::kGoogleGrey900, 0x24));
mixer[kColorOmniboxBubbleOutlineExperimentalKeywordMode] = {
kColorOmniboxSelectedKeyword};
// Results background colors.
mixer[kColorOmniboxResultsBackground] =
ui::GetColorWithMaxContrast(ui::FromResultColor(kColorOmniboxText));
ui::GetColorWithMaxContrast(kColorOmniboxText);
mixer[kColorOmniboxResultsBackgroundHovered] = ui::BlendTowardMaxContrast(
ui::FromResultColor(kColorOmniboxResultsBackground),
gfx::kGoogleGreyAlpha200);
kColorOmniboxResultsBackground, gfx::kGoogleGreyAlpha200);
mixer[kColorOmniboxResultsBackgroundSelected] = ui::BlendTowardMaxContrast(
ui::GetColorWithMaxContrast(
ui::FromResultColor(kColorOmniboxResultsTextSelected)),
ui::GetColorWithMaxContrast(kColorOmniboxResultsTextSelected),
gfx::kGoogleGreyAlpha300);
// Results icon colors.
{
const auto results_icon = [minimum_contrast](ui::ColorId text_id,
ui::ColorId background_id) {
return ui::BlendForMinContrast(
ui::DeriveDefaultIconColor(ui::FromResultColor(text_id)),
ui::FromResultColor(background_id), base::nullopt, minimum_contrast);
return ui::BlendForMinContrast(ui::DeriveDefaultIconColor(text_id),
background_id, base::nullopt,
minimum_contrast);
};
mixer[kColorOmniboxResultsIcon] =
results_icon(kColorOmniboxText, kColorOmniboxResultsBackground);
......@@ -75,11 +72,9 @@ void AddOmniboxColorMixer(ui::ColorProvider* provider, bool high_contrast) {
ui::ColorId foreground_id,
ui::ColorId background_id) {
return ui::BlendForMinContrast(
ui::FromResultColor(foreground_id),
ui::FromResultColor(foreground_id),
ui::BlendForMinContrast(ui::FromResultColor(background_id),
ui::FromResultColor(background_id),
base::nullopt, minimum_contrast),
foreground_id, foreground_id,
ui::BlendForMinContrast(background_id, background_id, base::nullopt,
minimum_contrast),
minimum_contrast);
};
mixer[kColorOmniboxResultsTextDimmed] = blend_with_clamped_contrast(
......@@ -95,9 +90,9 @@ void AddOmniboxColorMixer(ui::ColorProvider* provider, bool high_contrast) {
{
const auto url_color = [minimum_contrast](ui::ColorId id) {
return ui::BlendForMinContrast(
gfx::kGoogleBlue500, ui::FromResultColor(id),
ui::SelectBasedOnDarkInput(ui::FromResultColor(id),
gfx::kGoogleBlue050, gfx::kGoogleBlue900),
gfx::kGoogleBlue500, id,
ui::SelectBasedOnDarkInput(id, gfx::kGoogleBlue050,
gfx::kGoogleBlue900),
minimum_contrast);
};
mixer[kColorOmniboxResultsUrl] =
......@@ -111,19 +106,16 @@ void AddOmniboxColorMixer(ui::ColorProvider* provider, bool high_contrast) {
const auto security_chip_color =
[minimum_contrast](ui::ColorTransform transform) {
return ui::SelectBasedOnDarkInput(
ui::FromResultColor(kColorOmniboxBackground),
ui::BlendTowardMaxContrast(ui::FromResultColor(kColorOmniboxText),
0x18),
ui::BlendForMinContrast(
std::move(transform),
ui::FromResultColor(kColorOmniboxBackgroundHovered),
base::nullopt, minimum_contrast));
kColorOmniboxBackground,
ui::BlendTowardMaxContrast(kColorOmniboxText, 0x18),
ui::BlendForMinContrast(std::move(transform),
kColorOmniboxBackgroundHovered,
base::nullopt, minimum_contrast));
};
mixer[kColorOmniboxSecurityChipDangerous] =
security_chip_color(gfx::kGoogleRed600);
mixer[kColorOmniboxSecurityChipSecure] = security_chip_color(
ui::DeriveDefaultIconColor(ui::FromResultColor(kColorOmniboxText)));
mixer[kColorOmniboxSecurityChipSecure] =
security_chip_color(ui::DeriveDefaultIconColor(kColorOmniboxText));
}
mixer[kColorOmniboxSecurityChipDefault] =
ui::FromResultColor(kColorOmniboxSecurityChipSecure);
mixer[kColorOmniboxSecurityChipDefault] = {kColorOmniboxSecurityChipSecure};
}
......@@ -230,8 +230,7 @@ TEST(ColorMixerTest, GetResultColorChained) {
mixer[kColorTest1] = BlendTowardMaxContrast(
GetColorWithMaxContrast(FromTransformInput()), 0x29);
mixer[kColorTest2] =
BlendForMinContrast(gfx::kGoogleBlue500, FromResultColor(kColorTest1),
FromResultColor(kColorTest0));
BlendForMinContrast(gfx::kGoogleBlue500, kColorTest1, kColorTest0);
EXPECT_EQ(SkColorSetRGB(0x89, 0xB3, 0xF8), mixer.GetResultColor(kColorTest2));
}
......
......@@ -29,7 +29,7 @@ TEST(ColorRecipeTest, EmptyRecipeIsPassthrough) {
// Tests that a transform in a recipe has an effect.
TEST(ColorRecipeTest, OneTransform) {
constexpr SkColor kOutput = SK_ColorGREEN;
ColorRecipe recipe = ColorTransform(kOutput);
ColorRecipe recipe = {kOutput};
const auto verify_transform = [&](SkColor input) {
EXPECT_EQ(kOutput, recipe.GenerateResult(input, ColorMixer()));
};
......@@ -40,9 +40,8 @@ TEST(ColorRecipeTest, OneTransform) {
// Tests that in a recipe with multiple transforms, each is applied.
TEST(ColorRecipeTest, ChainedTransforms) {
ColorRecipe recipe =
DeriveDefaultIconColor(FromTransformInput()) +
BlendForMinContrast(FromTransformInput(), FromInputColor(kColorTest0));
ColorRecipe recipe = DeriveDefaultIconColor(FromTransformInput()) +
BlendForMinContrast(FromTransformInput(), kColorTest0);
constexpr SkColor kBackground = SK_ColorWHITE;
ColorMixer mixer;
mixer.AddSet({kColorSetTest0, {{kColorTest0, kBackground}}});
......
......@@ -5,6 +5,7 @@
#include "ui/color/color_transform.h"
#include "base/bind.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/color/color_mixer.h"
namespace ui {
......@@ -18,6 +19,15 @@ ColorTransform::ColorTransform(SkColor color) {
callback_ = base::Bind(generator, color);
}
ColorTransform::ColorTransform(ColorId id) {
DCHECK_COLOR_ID_VALID(id);
const auto generator = [](ColorId id, SkColor input_color,
const ColorMixer& mixer) {
return mixer.GetResultColor(id);
};
callback_ = base::Bind(generator, id);
}
ColorTransform::ColorTransform(const ColorTransform&) = default;
ColorTransform& ColorTransform::operator=(const ColorTransform&) = default;
......@@ -125,24 +135,6 @@ ColorTransform FromOriginalColorFromSet(ColorId id, ColorSetId set_id) {
return base::Bind(generator, id, set_id);
}
ColorTransform FromInputColor(ColorId id) {
DCHECK_COLOR_ID_VALID(id);
const auto generator = [](ColorId id, SkColor input_color,
const ColorMixer& mixer) {
return mixer.GetInputColor(id);
};
return base::Bind(generator, id);
}
ColorTransform FromResultColor(ColorId id) {
DCHECK_COLOR_ID_VALID(id);
const auto generator = [](ColorId id, SkColor input_color,
const ColorMixer& mixer) {
return mixer.GetResultColor(id);
};
return base::Bind(generator, id);
}
ColorTransform FromTransformInput() {
const auto generator = [](SkColor input_color, const ColorMixer& mixer) {
return input_color;
......
......@@ -29,6 +29,8 @@ class COMPONENT_EXPORT(COLOR) ColorTransform {
ColorTransform(Callback callback);
// Creates a transform that returns the supplied |color|.
ColorTransform(SkColor color);
// Creates a transform that returns the result color for the supplied |id|.
ColorTransform(ColorId id);
ColorTransform(const ColorTransform&);
ColorTransform& operator=(const ColorTransform&);
~ColorTransform();
......@@ -86,12 +88,6 @@ ColorTransform DeriveDefaultIconColor(ColorTransform transform);
COMPONENT_EXPORT(COLOR)
ColorTransform FromOriginalColorFromSet(ColorId id, ColorSetId set_id);
// A transform which returns the input color |id|.
COMPONENT_EXPORT(COLOR) ColorTransform FromInputColor(ColorId id);
// A transform which returns the result color |id|.
COMPONENT_EXPORT(COLOR) ColorTransform FromResultColor(ColorId id);
// A transform which returns the transform's input color (i.e. does nothing).
// This is useful to supply as an argument to other transforms to control how
// the input color is routed.
......
......@@ -41,7 +41,7 @@ TEST(ColorTransformTest, AlphaBlend) {
// background color.
TEST(ColorTransformTest, BlendForMinContrast) {
const ColorTransform transform =
BlendForMinContrast(FromTransformInput(), FromInputColor(kColorTest0));
BlendForMinContrast(FromTransformInput(), kColorTest0);
constexpr SkColor kBackground = SK_ColorWHITE;
ColorMixer mixer;
mixer.AddSet({kColorSetTest0, {{kColorTest0, kBackground}}});
......@@ -60,9 +60,8 @@ TEST(ColorTransformTest, BlendForMinContrast) {
// ratio.
TEST(ColorTransformTest, BlendForMinContrastOptionalArgs) {
constexpr float kMinContrast = 6.0f;
const ColorTransform transform =
BlendForMinContrast(FromTransformInput(), FromInputColor(kColorTest0),
FromInputColor(kColorTest1), kMinContrast);
const ColorTransform transform = BlendForMinContrast(
FromTransformInput(), kColorTest0, kColorTest1, kMinContrast);
constexpr SkColor kBackground = SK_ColorWHITE;
ColorMixer mixer;
mixer.AddSet(
......@@ -172,31 +171,15 @@ TEST(ColorTransformTest, FromOriginalColorFromSet) {
verify_color(SK_ColorRED);
}
// Tests that FromInputColor() produces a transform that ignores
// the input color and always outputs a specified input color.
TEST(ColorTransformTest, FromInputColor) {
const ColorTransform transform = FromInputColor(kColorTest0);
constexpr SkColor kTest0Color = SK_ColorGREEN;
ColorMixer mixer;
mixer.AddSet({kColorSetTest0,
{{kColorTest0, kTest0Color}, {kColorTest1, SK_ColorRED}}});
const auto verify_color = [&](SkColor input) {
EXPECT_EQ(kTest0Color, transform.Run(input, mixer));
};
verify_color(SK_ColorBLACK);
verify_color(SK_ColorWHITE);
verify_color(SK_ColorRED);
} // namespace
// Tests that FromResultColor() produces a transform that ignores
// the input color and always outputs a specified result color.
TEST(ColorTransformTest, FromResultColor) {
const ColorTransform transform = FromResultColor(kColorTest0);
// Tests that a transform created from a ColorId produces a transform that
// ignores the input color and always outputs a specified result color.
TEST(ColorTransformTest, FromColorId) {
const ColorTransform transform = {kColorTest0};
constexpr SkColor kTest1Color = SK_ColorRED;
ColorMixer mixer;
mixer.AddSet({kColorSetTest0,
{{kColorTest0, SK_ColorGREEN}, {kColorTest1, kTest1Color}}});
mixer[kColorTest0] = FromInputColor(kColorTest1);
mixer[kColorTest0] = {kColorTest1};
const auto verify_color = [&](SkColor input) {
EXPECT_EQ(kTest1Color, transform.Run(input, mixer));
};
......@@ -234,7 +217,7 @@ TEST(ColorTransformTest, GetColorWithMaxContrast) {
// opaquely.
TEST(ColorTransformTest, GetResultingPaintColor) {
const ColorTransform transform =
GetResultingPaintColor(FromTransformInput(), FromInputColor(kColorTest0));
GetResultingPaintColor(FromTransformInput(), kColorTest0);
constexpr SkColor kBackground = SK_ColorWHITE;
ColorMixer mixer;
mixer.AddSet({kColorSetTest0, {{kColorTest0, kBackground}}});
......
......@@ -67,12 +67,11 @@ ColorMixer& AddMixerForLightMode(ColorProvider* provider) {
void AddCoreDefaultColorMixers(ColorProvider* provider, bool dark_window) {
ColorMixer& mixer = dark_window ? AddMixerForDarkMode(provider)
: AddMixerForLightMode(provider);
mixer[kColorSecondaryBackground] = BlendForMinContrastWithSelf(
FromResultColor(kColorPrimaryBackground), 1.67f);
mixer[kColorSecondaryBackground] =
BlendForMinContrastWithSelf(kColorPrimaryBackground, 1.67f);
mixer[kColorSecondaryForeground] =
BlendForMinContrast(FromResultColor(kColorDisabledForeground),
FromResultColor(kColorPrimaryBackground),
FromResultColor(kColorPrimaryForeground));
BlendForMinContrast(kColorDisabledForeground, kColorPrimaryBackground,
kColorPrimaryForeground);
// TODO(pkasting): High contrast?
}
......
......@@ -15,96 +15,77 @@ namespace ui {
void AddUiColorMixers(ColorProvider* provider) {
ColorMixer& mixer = provider->AddMixer();
mixer[kColorBubbleBackground] = FromInputColor(kColorPrimaryBackground);
mixer[kColorBubbleFooterBackground] =
FromInputColor(kColorSecondaryBackgroundSubtle);
mixer[kColorButtonBackground] = FromInputColor(kColorPrimaryBackground);
mixer[kColorButtonBorder] = FromInputColor(kColorSecondaryBackground);
mixer[kColorButtonDisabledForeground] =
FromInputColor(kColorDisabledForeground);
mixer[kColorButtonProminentBackground] = FromInputColor(kColorAccent);
mixer[kColorButtonProminentDisabledBackground] = AlphaBlend(
FromInputColor(kColorSecondaryBackground),
FromResultColor(kColorButtonBackground), gfx::kDisabledControlAlpha);
mixer[kColorButtonProminentFocusedBackground] = BlendForMinContrastWithSelf(
FromResultColor(kColorButtonProminentBackground), 1.3f);
mixer[kColorBubbleBackground] = {kColorPrimaryBackground};
mixer[kColorBubbleFooterBackground] = {kColorSecondaryBackgroundSubtle};
mixer[kColorButtonBackground] = {kColorPrimaryBackground};
mixer[kColorButtonBorder] = {kColorSecondaryBackground};
mixer[kColorButtonDisabledForeground] = {kColorDisabledForeground};
mixer[kColorButtonProminentBackground] = {kColorAccent};
mixer[kColorButtonProminentDisabledBackground] =
AlphaBlend(kColorSecondaryBackground, kColorButtonBackground,
gfx::kDisabledControlAlpha);
mixer[kColorButtonProminentFocusedBackground] =
BlendForMinContrastWithSelf(kColorButtonProminentBackground, 1.3f);
mixer[kColorButtonProminentForeground] =
GetColorWithMaxContrast(FromResultColor(kColorButtonProminentBackground));
mixer[kColorDialogBackground] = FromInputColor(kColorPrimaryBackground);
mixer[kColorFocusableBorderFocused] =
SetAlpha(FromInputColor(kColorAccent), 0x4D);
mixer[kColorFocusableBorderUnfocused] =
FromInputColor(kColorSecondaryBackground);
mixer[kColorLabelDisabledForeground] = SetAlpha(
FromResultColor(kColorLabelForeground), gfx::kDisabledControlAlpha);
mixer[kColorLabelForeground] = FromInputColor(kColorPrimaryForeground);
mixer[kColorLabelSelectionBackground] =
FromInputColor(kColorTextSelectionBackground);
mixer[kColorLabelSelectionForeground] =
FromResultColor(kColorLabelForeground);
mixer[kColorLinkDisabledForeground] = FromInputColor(kColorPrimaryForeground);
mixer[kColorLinkPressedForeground] = FromInputColor(kColorLinkForeground);
mixer[kColorMenuBackground] = FromInputColor(kColorPrimaryBackground);
mixer[kColorMenuBorder] = FromInputColor(kColorSecondaryBackground);
mixer[kColorMenuItemAlertedBackground] = FromInputColor(kColorAccent);
mixer[kColorMenuItemDisabledForeground] =
FromInputColor(kColorDisabledForeground);
mixer[kColorMenuItemForeground] = FromInputColor(kColorPrimaryForeground);
mixer[kColorMenuItemHighlightedBackground] =
FromInputColor(kColorSecondaryBackgroundSubtle);
mixer[kColorMenuItemHighlightedForeground] =
FromResultColor(kColorMenuItemForeground);
mixer[kColorMenuItemSecondaryForeground] =
FromInputColor(kColorSecondaryForeground);
mixer[kColorMenuItemSelectedBackground] =
FromInputColor(kColorSecondaryBackground);
mixer[kColorMenuItemSelectedForeground] =
FromResultColor(kColorMenuItemForeground);
mixer[kColorMenuSeparator] = FromInputColor(kColorSeparatorForeground);
mixer[kColorTabContentSeparator] = FromInputColor(kColorSecondaryBackground);
mixer[kColorTabForeground] = FromInputColor(kColorSecondaryForeground);
mixer[kColorTabSelectedForeground] = FromInputColor(kColorAccent);
mixer[kColorTableBackground] = FromInputColor(kColorPrimaryBackground);
mixer[kColorTableForeground] = FromInputColor(kColorPrimaryForeground);
mixer[kColorTableGroupingIndicator] =
FromResultColor(kColorTableSelectedFocusedBackground);
mixer[kColorTableHeaderBackground] = FromResultColor(kColorTableBackground);
mixer[kColorTableHeaderForeground] = FromResultColor(kColorTableForeground);
mixer[kColorTableHeaderSeparator] = FromInputColor(kColorSeparatorForeground);
mixer[kColorTableSelectedFocusedBackground] =
FromInputColor(kColorSecondaryBackground);
mixer[kColorTableSelectedFocusedForeground] =
FromResultColor(kColorTableForeground);
mixer[kColorTableSelectedUnfocusedBackground] =
FromResultColor(kColorTableSelectedFocusedBackground);
mixer[kColorTableSelectedUnfocusedForeground] =
FromResultColor(kColorTableSelectedFocusedForeground);
mixer[kColorTextfieldBackground] = FromInputColor(kColorPrimaryBackground);
mixer[kColorTextfieldDisabledBackground] =
FromResultColor(kColorTextfieldBackground);
mixer[kColorTextfieldDisabledForeground] = SetAlpha(
FromResultColor(kColorTextfieldForeground), gfx::kDisabledControlAlpha);
mixer[kColorTextfieldForeground] = FromInputColor(kColorPrimaryForeground);
mixer[kColorTextfieldSelectionBackground] =
FromInputColor(kColorTextSelectionBackground);
mixer[kColorTextfieldSelectionForeground] =
FromResultColor(kColorTextfieldForeground);
mixer[kColorThrobber] = FromInputColor(kColorAccent);
mixer[kColorTooltipBackground] = SetAlpha(
GetColorWithMaxContrast(FromInputColor(kColorPrimaryBackground)), 0xE9);
mixer[kColorTooltipForeground] = SetAlpha(
GetColorWithMaxContrast(FromResultColor(kColorTooltipBackground)), 0xDE);
mixer[kColorTreeBackground] = FromInputColor(kColorPrimaryBackground);
mixer[kColorTreeNodeForeground] = FromInputColor(kColorPrimaryForeground);
mixer[kColorTreeNodeSelectedFocusedBackground] =
FromInputColor(kColorSecondaryBackground);
mixer[kColorTreeNodeSelectedFocusedForeground] =
FromResultColor(kColorTreeNodeForeground);
mixer[kColorTreeNodeSelectedUnfocusedBackground] =
FromResultColor(kColorTreeNodeSelectedFocusedBackground);
mixer[kColorTreeNodeSelectedUnfocusedForeground] =
FromResultColor(kColorTreeNodeSelectedFocusedForeground);
mixer[kColorWindowBackground] = FromInputColor(kColorPrimaryBackground);
GetColorWithMaxContrast(kColorButtonProminentBackground);
mixer[kColorDialogBackground] = {kColorPrimaryBackground};
mixer[kColorFocusableBorderFocused] = SetAlpha(kColorAccent, 0x4D);
mixer[kColorFocusableBorderUnfocused] = {kColorSecondaryBackground};
mixer[kColorLabelDisabledForeground] =
SetAlpha(kColorLabelForeground, gfx::kDisabledControlAlpha);
mixer[kColorLabelForeground] = {kColorPrimaryForeground};
mixer[kColorLabelSelectionBackground] = {kColorTextSelectionBackground};
mixer[kColorLabelSelectionForeground] = {kColorLabelForeground};
mixer[kColorLinkDisabledForeground] = {kColorPrimaryForeground};
mixer[kColorLinkPressedForeground] = {kColorLinkForeground};
mixer[kColorMenuBackground] = {kColorPrimaryBackground};
mixer[kColorMenuBorder] = {kColorSecondaryBackground};
mixer[kColorMenuItemAlertedBackground] = {kColorAccent};
mixer[kColorMenuItemDisabledForeground] = {kColorDisabledForeground};
mixer[kColorMenuItemForeground] = {kColorPrimaryForeground};
mixer[kColorMenuItemHighlightedBackground] = {
kColorSecondaryBackgroundSubtle};
mixer[kColorMenuItemHighlightedForeground] = {kColorMenuItemForeground};
mixer[kColorMenuItemSecondaryForeground] = {kColorSecondaryForeground};
mixer[kColorMenuItemSelectedBackground] = {kColorSecondaryBackground};
mixer[kColorMenuItemSelectedForeground] = {kColorMenuItemForeground};
mixer[kColorMenuSeparator] = {kColorSeparatorForeground};
mixer[kColorTabContentSeparator] = {kColorSecondaryBackground};
mixer[kColorTabForeground] = {kColorSecondaryForeground};
mixer[kColorTabSelectedForeground] = {kColorAccent};
mixer[kColorTableBackground] = {kColorPrimaryBackground};
mixer[kColorTableForeground] = {kColorPrimaryForeground};
mixer[kColorTableGroupingIndicator] = {kColorTableSelectedFocusedBackground};
mixer[kColorTableHeaderBackground] = {kColorTableBackground};
mixer[kColorTableHeaderForeground] = {kColorTableForeground};
mixer[kColorTableHeaderSeparator] = {kColorSeparatorForeground};
mixer[kColorTableSelectedFocusedBackground] = {kColorSecondaryBackground};
mixer[kColorTableSelectedFocusedForeground] = {kColorTableForeground};
mixer[kColorTableSelectedUnfocusedBackground] = {
kColorTableSelectedFocusedBackground};
mixer[kColorTableSelectedUnfocusedForeground] = {
kColorTableSelectedFocusedForeground};
mixer[kColorTextfieldBackground] = {kColorPrimaryBackground};
mixer[kColorTextfieldDisabledBackground] = {kColorTextfieldBackground};
mixer[kColorTextfieldDisabledForeground] =
SetAlpha(kColorTextfieldForeground, gfx::kDisabledControlAlpha);
mixer[kColorTextfieldForeground] = {kColorPrimaryForeground};
mixer[kColorTextfieldSelectionBackground] = {kColorTextSelectionBackground};
mixer[kColorTextfieldSelectionForeground] = {kColorTextfieldForeground};
mixer[kColorThrobber] = {kColorAccent};
mixer[kColorTooltipBackground] =
SetAlpha(GetColorWithMaxContrast(kColorPrimaryBackground), 0xE9);
mixer[kColorTooltipForeground] =
SetAlpha(GetColorWithMaxContrast(kColorTooltipBackground), 0xDE);
mixer[kColorTreeBackground] = {kColorPrimaryBackground};
mixer[kColorTreeNodeForeground] = {kColorPrimaryForeground};
mixer[kColorTreeNodeSelectedFocusedBackground] = {kColorSecondaryBackground};
mixer[kColorTreeNodeSelectedFocusedForeground] = {kColorTreeNodeForeground};
mixer[kColorTreeNodeSelectedUnfocusedBackground] = {
kColorTreeNodeSelectedFocusedBackground};
mixer[kColorTreeNodeSelectedUnfocusedForeground] = {
kColorTreeNodeSelectedFocusedForeground};
mixer[kColorWindowBackground] = {kColorPrimaryBackground};
}
} // namespace ui
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