After some research, I came to the conclusion that decided it for me, I hope it helps you too.
Step 1: Create your own custom color palettes.
I found this wonderful website on which you enter the color of your brand, and it creates a complete palette with various shades of color of this brand: http://mcg.mbitson.com
I used this tool for both the primary color (the color of my brand) and for the color accent .
Step 2. Create palettes in your theme file
Here is a guide to creating such a .scss file: https://github.com/angular/material2/blob/master/guides/theming.md
@import ' ~@angular /material/theming'; // Be sure that you only ever include 'mat-core' mixin once! // it should not be included for each theme. @include mat-core(); // define a real custom palette (using http://mcg.mbitson.com) $bv-brand: ( 50:
Some explanation on the code above
The numbers on the left set the "level" of brightness. The default value is 500 (this is the true shade of my signature / accent color). So in this example, the color of my brand is #5282c1 . The rest are other shades of this color (where lower numbers mean brighter shades, and higher numbers mean darker shades). AXXX different shades. Not sure (yet) where they are used. Again, the smaller the number, the brighter, and the higher, the darker.
contrast sets the font color over these background colors. Using CSS is very difficult (or even impossible) to calculate where the font should be bright (white) or dark (black with an opacity of 0.87) so that it can be easily read even by color blind. So this is manually set and hardcoded in the palette definition. You also get this from the palette generator that I linked above (although it is displayed in the old Material1 format, and you will have to manually convert it to Material2 format, as I posted here).
Set the theme to use a proprietary color palette as the primary color, and all that you have for accent is the color accent .
Step 3: Use a theme throughout the application where you can
Some elements can take theme colors, such as <md-toolbar> , <md-input> , <md-button> , <md-select> and so on. They will use primary by default, so make sure you select the brand color palette as the primary one. If you want to change the color, use the color directive (is it an angular directive?).
For instance:
<button mat-raised-button color="accent" type="submit">Login</button>