MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

New colors don't match old v4.x colors

Đang mở
#3,590 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug evaluation required
Ngôn ngữ chính
C#
Star
16.3k
Fork
3.5k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
8

Mô tả

### 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](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/assets/58171461/696d602e-abb1-43a7-b139-67e3a8be1d60)

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](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/assets/58171461/f0d8d024-a6f2-4722-a69f-f731a4f29200)
![firefox_MVdXHc9DUt](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/assets/58171461/1b9bfeee-d757-4b8b-8775-7ba360e857de)

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](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/assets/58171461/ab53ab21-01b6-416d-a48e-f94ceebdb303)

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với MaterialDesignTheme.ObsoleteBrushes.xaml và entry point ThemeAssist.GetResourceDictionarySource được nêu trong issue. So sánh các ánh xạ đã lỗi thời và các tài nguyên của theme sáng/tối với các kỳ vọng về surface của v4.x và MD3 đã được báo cáo. Công việc được xem là hoàn tất khi đã thống nhất một lược đồ màu surface và quyết định cách tiếp cận cho các resource dictionary của theme tùy chỉnh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp
Lĩnh vực
design, desktop
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.