Angular Material - 改变对比色的不透明度

Angular Material - changing contrast color opacity

我为我的 Angular + Angular-Material 项目定义了一个自定义调色板,将 contrastDefaultColor 设置为亮色。问题是光线是白色的,不透明度为 0.87 - 我需要它的不透明度为 1.00。如何显式声明 contrastDefaultColor 或至少提高不透明度?

调色板:

  const blues = {
      '50': '#45ccff',
      '100': '#2cc5ff',
      '200': '#12beff',
      '300': '#00b4f8',
      '400': '#00a1de',
      '500': '#008fc5',
      '600': '#007cab',
      '700': '#006a92',
      '800': '#005778',
      '900': '#00455f',
      'A100': '#5fd3ff',
      'A200': '#78daff',
      'A400': '#92e1ff',
      'A700': '#003245',
      'contrastDefaultColor': 'light'
  };

解决方案是指定 'constrastStrongLightColors' 属性 并将值设置为调色板中的所有颜色。这确保任何具有对比背景的文本都将是 "strong"(不透明度 = 1)。

  const blues = {
      '50': '#45ccff',
      '100': '#2cc5ff',
      '200': '#12beff',
      '300': '#00b4f8',
      '400': '#00a1de',
      '500': '#008fc5',
      '600': '#ffffff',
      '700': '#006a92',
      '800': '#005778',
      '900': '#00455f',
      'A100': '#5fd3ff',
      'A200': '#78daff',
      'A400': '#92e1ff',
      'A700': '#003245',
      'contrastDefaultColor': 'light',
      'contrastStrongLightColors': ['50', '100', '200', '300', '400', '500', '600', '700', '800', '900', 'A100', 'A200', 'A400', 'A700']
  };