-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/schematics): estimate missing hues in M3 schematic #29231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We use `@material/material-color-utilities` to generate the palettes in the M3 `ng generate` schematic, but it appears that the utilities don't generate all the neutral hues for some colors which leads to transparent dropdowns (see angular#29157). We handle this in our built in palettes by estimating the missing hues based on the hues around them. These changes port the estimation logic to the schematic to ensure that we always generate full themes. Fixes angular#29157.
|
||
let newNeutral: Map<number, string> | null = null; | ||
|
||
for (const [hue, {prev, next}] of NEUTRAL_HUES) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic here can be simplified, but I wanted to avoid mutating the original map.
We use `@material/material-color-utilities` to generate the palettes in the M3 `ng generate` schematic, but it appears that the utilities don't generate all the neutral hues for some colors which leads to transparent dropdowns (see #29157). We handle this in our built in palettes by estimating the missing hues based on the hues around them. These changes port the estimation logic to the schematic to ensure that we always generate full themes. Fixes #29157. (cherry picked from commit 3da4323)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
We use
@material/material-color-utilities
to generate the palettes in the M3ng generate
schematic, but it appears that the utilities don't generate all the neutral hues for some colors which leads to transparent dropdowns (see #29157). We handle this in our built in palettes by estimating the missing hues based on the hues around them.These changes port the estimation logic to the schematic to ensure that we always generate full themes.
Fixes #29157.