使用默認的主題,你只能選擇之間:
- 紅色
- 粉色
- 紫色
- 深紫色
- 靛藍
- 藍色
- 淡藍色
- 青色
- 水鴨
- 綠色
- 淺綠色
- 石灰
- 黃色
- 琥珀
- 橙色
- 深橙色
- 棕色
- 灰色
- 藍灰色
據商務部:https://material.angularjs.org/latest/#/Theming/01_introduction
如果你想自定義顏色,你需要定義自己的調色板
angular.module('myApp', ['ngMaterial'])
.config(function($mdThemingProvider) {
$mdThemingProvider.definePalette('amazingPaletteName', {
'50': 'ffebee',
'100': 'ffcdd2',
'200': 'ef9a9a',
'300': 'e57373',
'400': 'ef5350',
'500': 'f44336',
'600': 'e53935',
'700': 'd32f2f',
'800': 'c62828',
'900': 'b71c1c',
'A100': 'ff8a80',
'A200': 'ff5252',
'A400': 'ff1744',
'A700': 'd50000',
'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': undefined // could also specify this if default was 'dark'
});
$mdThemingProvider.theme('default')
.primaryPalette('amazingPaletteName')
});
Se:https://material.angularjs.org/latest/#/Theming/03_configuring_a_theme
你試過這個嗎?結果是什麼?爲什麼結果不夠? – Risadinha