如何通过定义我自己的自定义调色板来更改工具栏的文本颜色?或者一般我如何设置文本的颜色?
app.config(function($mdThemingProvider) {
$mdThemingProvider.definePalette('accent', {
'50': '#FFEB3B',
'100': '#FFEB3B',
'200': '#FFEB3B',
'300': '#FFEB3B',
'400': '#FFEB3B',
'500': '#FFEB3B',
'600': '#FFEB3B',
'700': '#FFEB3B',
'800': '#FFEB3B',
'900': '#FFEB3B',
'A100': '#FFEB3B',
'A200': '#FFEB3B',
'A400': '#FFEB3B',
'A700': '#FFEB3B',
'contrastDefaultColor': 'dark', // whether, by default, text (contrast)
// on this palette should be dark or light
'contrastDarkColors': ['50', '100', //hues which contrast should be 'dark' by default
'200', '300', '400', 'A100'],
'contrastLightColors': undefined
});
$mdThemingProvider.definePalette('primary', {
'50': '#FFEB3B',
'100': '000000',
'200': '000000',
'300': '000000',
'400': '#FFEB3B',
'500': '000000',
'600': '000000',
'700': '000000',
'800': '000000',
'900': '#FFEB3B',
'A100': '#FFFFFF',
'A200': '000000',
'A400': '000000',
'A700': '#FFEB3B',
'contrastDefaultColor': 'light', // whether, by default, text (contrast)
// on this palette should be dark or light
'contrastDarkColors': ['50', '100', //hues which contrast should be 'dark' by default
'200', '300', '400', 'A100'],
'contrastLightColors': []
});
$mdThemingProvider.theme('default')
.primaryPalette('primary')
.accentPalette('accent');
});
属性 contrastDefaultColor 控制工具栏中文本的颜色,但只能设置为“浅色”或“深色”,因此它可以是白色或黑色,但我希望它是黄色的。