gpt4 book ai didi

flutter - Flutter 的深色模式颜色

转载 作者:行者123 更新时间:2023-12-03 13:31:08 28 4
gpt4 key购买 nike

在本站material.io它写道:

To create branded dark surfaces, overlay the primary brand color at a low opacity over the recommended dark theme surface color (#121212). The color #1F1B24 is the result of combining the dark theme surface color #121212 and the 8% Primary color.



Brand Color

我的问题是:
  • 如何计算 8% 的颜色?
  • 如何在 中实现这个覆盖的东西 flutter ?
  • 最佳答案

    不使用小部件的覆盖解决方案是使用 Color.alphaBlend哪一个

    combine[s] the foreground color as a transparent color over top of a background color, and return[s] the resulting combined color.



    你像这样使用它:
    Color newColor = Color.alphaBlend(foregroundColor, backgroundColor);

    关于flutter - Flutter 的深色模式颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59433505/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com