Skip to content

mat.get-color-from-palette not working for contrast values #23230

Closed
@ibenjelloun

Description

@ibenjelloun

Reproduction

https://stackblitz.com/edit/angular-ivy-3vbd2j?file=src/styles.scss

color value for .custom-element is not set by mat.get-color-from-palette($my-primary, 700-contrast);
background-color is set correctly with mat.get-color-from-palette($my-primary, 700);

Expected Behavior

According to documentation : we can get the constrast of a hue by adding -contrast to the hue number mat.get-color-from-palette($my-primary, 700-contrast);

Actual Behavior

The value of the color when adding -constrast is empty

Environment

  • Angular: 12.1.3
  • CDK/Material: 12.1.3
  • Browser(s): Chrome 92.0.4515.107
  • Operating System: Windows

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: theming

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions