gpt4 book ai didi

c# - WPF 颜色定义困惑

转载 作者:行者123 更新时间:2023-11-30 20:02:15 25 4
gpt4 key购买 nike

为什么在 WPF 中颜色“Gray”比颜色“DarkGray”更暗。我的逻辑是“DarkGray”应该更暗。

不应该是LightGray、Gray、Darkgray吗?

最佳答案

这些颜色名称其实是come来自 CSS Color Module Level 3 W3C Recommendation而 Gray 和 Dark gray 的奇怪定义实际上来自合并 X11 和 web 标准。引用wikipedia :

Perhaps most unusual of the color clashes between X11 and W3C is the case of Gray. In HTML, Gray is specifically reserved for the 128 triplet, i.e. 50% gray. However, in X11, ‘gray’ was assigned to the 190 triplet, i.e. 75%, which is close to W3C ‘Silver’, and had ‘Light Gray’ at 211 and ‘Dark Gray’ at 169 counterparts. This resulted in W3C’s ‘Gray’, at 50%, actually being significantly darker than ‘Dark Gray’, at 66%.

关于c# - WPF 颜色定义困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17049730/

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