angular / angular/components

Material 3 Custom Theme schematic generates palette with wrong colors

Đang mở
#31,691 4 bình luận 1 reaction 1 người được giao Được @andrewseguin nhận Xem trên GitHub
area: theming P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

I have an issue with Material 3 Custom Theme schematic.

https://github.com/angular/components/blob/main/src/material/schematics/ng-generate/theme-color/README.md says that

> The generated [color palettes](https://m3.material.io/styles/color/roles) are optimized to have enough contrast to be more accessible

I understand that, but what about situation when i have #319a97 primary color and generated palette looks like this:

Image

Color "40" #006a68 is used as default and it is much darker. Does not fit the design at all and as you can see primary color #319a97 is completely missing from the palette.

Image

It results in manual override of desired colors to fit the design as it is meant to be.

Can you please kindly explain what am i missing or what am i doing wrong? Thank you.

### Expected Behavior

Generated color palette fits exactly colors that i input during the dialog during generation.

### Actual Behavior

Generated color palette color is much darker to keep contrast for accessibility purpose.

### Environment

- Angular: 20.1.0
- CDK/Material: 20.1.5
- Browser(s): any
- Operating System (e.g. Windows, macOS, Ubuntu): any

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

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

Đánh giá

Issue này chưa được đánh giá.

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.