Adjusts the color s hue with a degree from 360deg to 360deg.
Scss mat color.
Let s import both.
What you shouldn t do.
However if you have to preserve the existing behavior darken.
This is how color palettes are defined in angular material.
In src styles scss i have.
This function adds or subtracts the specified amount to from the existing color value.
Angular material theme definition file.
I am hoping to have the background of a mat sidenav the same as my mat toolbar theme color.
The color names and values themselves are taken from the official material design color guidelines.
The numbers behind the palette variable name select particular shades of chosen color for default lighter and darker variants if no numbers are provided.
First of let s take a look at the angular material color palette to understand how it works.
By simply importing the theme scss into styles scss you can tap into.
Adjust color color red green blue hue saturation lightness alpha adjusts one or more parameters by the specified amount.
Mat palette takes a color name as its first argument.
You can find theming file here.
To make a color a certain percentage darker than it was before use color scale instead.
Because darken is usually not the best way to make a color darker it s not included directly in the new module system.
Generating angular material custom color palette.
The darken function decreases lightness by a fixed amount which is often not the desired effect.
The next thing we need to do is to generate color palettes which can then be composed to an actual theme.
To generate a color palette we can use angular material s mat palette mix in.
Mat palette takes a base palette yes that s another palette more on that in a second and returns a new palette that comes with material specific hue color values for light.