MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

New colors don't match old v4.x colors

未关闭
#3,590 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug evaluation required
主要语言
C#
星标
16.3k
派生
3.5k
平均合并
1 天 22 小时
30 天内合并 PR
8

描述

Bug explanation

When using MaterialDesignTheme.ObsoleteBrushes.xaml to substitute the new colors to the old ones, the swap isn't good enough. For instance, some of the colors:

LgSprYsEft

It can clearly be seen that, in dark mode, the old background being substituted by the card background is not at all the same. I used it as the lowest layer of the app, but now it doesn't work anymore for that. In light mode instead, the situation wasn't great before either with way too much similarity between the colors, and now it's even worse, with the colors having been reduced to just two shades.

This all scheme also doesn't really match MD3 guidelines, since it doesn't really go from the lowest surface to the highest surface, like this:

firefox_mnPbr4Rec6
firefox_MVdXHc9DUt

Up until now I've personally used the surfaces as lowest to highest like this: Background->Toolbar->Paper->Card

  1. We could keep doing this by fixing the colors so that they follow more MD3 guidelines, maybe with a couple more surfaces.
  2. Alternatively, new colors could be added to represent the various surfaces (ie MaterialDesign.Brush.Surface.Lowest etc...)
  3. Alternatively, again, the ElevationAssist.Elevation could be used in some way to change the colors, but I wouldn't know how.

In my opinion, the first one would be easier to do and less disruptive to everyone's work. I've tried throwing together as a proposal:

immagine

Other things that could be added would be more Neutral colors, so every x50 step from 0 to 1000 in order to have more granularity. I'm not sure how the colors were chosen, though.

Also a simple way to substitute the default themes with custom ones (ie create my one resource dictionary and pass it to the ThemeAssist when calling ChangeTheme(). Right now I can only find this hard-coded reference to the themes:

private static string? GetResourceDictionarySource(BaseTheme theme)
{
    return theme switch
    {
        BaseTheme.Light => "pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml",
        BaseTheme.Dark => "pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml",
        _ => null,
    };
}

I'm not sure what would be the best way to pass a new dictionary to the ThemeAssist, or if it's even the best place to do such thing.

What do you think?

Version

5.0.0

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 MaterialDesignTheme.ObsoleteBrushes.xaml 和 issue 中所示的入口点 ThemeAssist.GetResourceDictionarySource 开始。将已弃用的映射以及浅色/深色主题资源与所报告的 v4.x 和 MD3 surface 预期进行比较。完成这项工作需要就 surface-color 方案达成一致,并确定处理自定义主题资源字典的方法。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
design, desktop
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。