By default your Angular Material application will use the default theme, a theme that is pre-configured with the following palettes for intention groups:
Configuring of the default theme is done by using the $mdThemingProvider
during application configuration.
You can specify a color palette for a given color intention by calling the
appropriate configuration method (theme.primaryPalette
, theme.accentPalette
,
theme.warnPalette
, theme.backgroundPalette
).
You can mark a theme as dark by calling theme.dark()
.
You can specify the hues from a palette that will be used by an intention group
by default and for the md-hue-1
, md-hue-2
, md-hue-3
classes.
By default, shades 500
, 300
800
and A100
are used for primary
and
warn
intentions, while A200
, A100
, A400
and A700
are used for accent
.
md-hue-1
class
'hue-2': '600', // use shade 600 for the md-hue-2
class
'hue-3': 'A100' // use shade A100 for the md-hue-3
class
})
// If you specify less than all of the keys, it will inherit from the
// default shades
.accentPalette('purple', {
'default': '200' // use shade 200 for default, and keep all other shades the same
});
});
As mentioned before, Angular Material ships with the Material Design
Spec's color palettes built in. In the event that you need to define a custom color palette, you can use $mdThemingProvider
to define it, thereby making
it available to your theme for use in its intention groups. Note that you must
specify all hues in the definition map.
Sometimes it is easier to extend an existing color palette to overwrite a few
colors than define a whole new one. You can use $mdThemingProvider.extendPalette
to quickly extend an existing color palette.
neonRed
$mdThemingProvider.definePalette('neonRed', neonRedMap);
// Use that theme for the primary intentions
$mdThemingProvider.theme('default')
.primaryPalette('neonRed')
});