When creating a new project that uses Material Design, one initial choice you need to make is your theme. A number of built in themes are included with Material, but what if none of those fit with the client’s color scheme? In this case, you need to create your own theme. But how?
Simple single colors don’t work because there are several times shading needs to occur. So, how do we know which to select? One solution is to use an online tool such as Material Design Palette Generator. In the top right of their website is a base-color selector. Once you select a base color, the app automatically determines the other necessary colors.
If you click the clipboard to the left of that color selector, you can get the code to export into your project. If you are using Angular Material, you will want them all collected into a single variable for importing into their mat-palette function. This single variable can be found with the Angular JS 2 (Material 2) option down the left-hand side.
You can then put that into your own
_palette.scss file and import it into the
custom-theme.scss file that’s created when you import the Angular Material package. If you’re using a UI framework other than Angular, explore the options on the clipboard in the Palette Generator to find the format you need.
If your project does not use these exact packages, the key principles still apply. For a Material theme, 14 distinct colors are needed as lighter and darker shades of the base color. There are many tools to get gradient colors. Now that you know the format Material Theming requires, configuring your color themes is far easier. Finally, if you still have any questions about Material Themes, please don’t hesitate to reach out to us. We’d love to help you get started.