Angular material 角度材质主题化中的色调

Angular material 角度材质主题化中的色调,angular-material,Angular Material,定义调色板时,颜色实际会影响什么 hpsapf-primary: mat-palette($mat-light-blue, 400, 50, 900); 第一个值(400)是默认色调 第二个值(50)是较浅的色调 第三个值(900)是较暗的色调 在组件上设置color=“primary”时使用默认色调 // The button gets the color #29B6F6 as can be looked up here: https://material.io/design/color

定义调色板时,颜色实际会影响什么

hpsapf-primary: mat-palette($mat-light-blue, 400, 50, 900);
  • 第一个值(400)是默认色调
  • 第二个值(50)是较浅的色调
  • 第三个值(900)是较暗的色调
在组件上设置color=“primary”时使用默认色调

// The button gets the color #29B6F6 as can be looked up here: https://material.io/design/color/#tools-for-picking-colors
<button mat-button color="primary">Primary</button>
//按钮获取颜色#29B6F6,可在此处查看:https://material.io/design/color/#tools-用于挑选颜色
主要的,重要的

那么,棱角材质如何使用较浅(50)和较深(900)的色调,或者我如何使用它们?它们有什么好处?

可以通过查看角度材质源代码来了解它们的使用方法。更具体地说,请查看一些组件主题化混合文件。例如:

可以通过“主题化”实用程序的混合和功能以及默认、较亮、较暗、默认对比度、较亮对比度和较暗对比度调色板贴图键以相同的方式使用它们。主题指南对此进行了解释:。

更新: 第一个答案有点正确,想法就在那里,我把我的答案放在后面。对于像我这样刚接触棱角材料的人来说,这有点模糊。下面或这里的链接确实回答了我的需要。前面的答案可能适用于进度条,但现在我看不出它如何适用于按钮。如果有人知道怎么做,请帮忙。Angular的文档有点稀疏。不过我还是希望我能像这样使用它

<button mat-button color="primary darker">Primary darker</button>
<button mat-button color="primary default">2nd default</button>
<button mat-button color="primary default">3rd default</button>
原色较暗
也许在它旁边,我希望颜色是默认的,然后我可以像这样使用它

<button mat-button color="primary darker">Primary darker</button>
<button mat-button color="primary default">2nd default</button>
<button mat-button color="primary default">3rd default</button>
2次默认值
第三次违约
我想这就是问题的症结所在。 更新结束

因为这里的答案都离我们很近。他们似乎没有抓住要点。我们有些人对颜色有点挑剔。所以,让我试着重新表述一下问题是什么

他只是想用这样的东西:

<button mat-button color="primary default">Primary default</button>
<button mat-button color="primary lighter">Primary lighter</button>
<button mat-button color="primary darker">Primary darker</button>
主默认值
初级打火机
原色暗色
我希望这就是他想问的,因为这似乎是事实

我想在这里可以找到答案


如果这样做有效的话,这是我能想到的最接近可能有效的方法。我稍后会尝试,稍后会编辑这篇文章。

欢迎来到SO!你能澄清你的问题吗?