如何使用正确的 Windows 系统颜色?
我想使用 XAML 设置 WPF 按钮的样式,使其看起来像这些 Windows 7 通知区域浮出控件的“混合器”和“更改日期和时间设置...”文本。
SystemColors 的属性是否定义了该颜色?哪个?
<Setter Property="Foreground"
Value="{DynamicResource {x:Static SystemColors.????}}" />
I want to use XAML to style a WPF button to look like the "Mixer" and "Change date and time settings..." text of these Windows 7 Notification area flyouts.
Does a property of SystemColors define that color? Which?
<Setter Property="Foreground"
Value="{DynamicResource {x:Static SystemColors.????}}" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我发现的最好的方法是实验和猜测。
我创建了一个小实用程序来可视化这些颜色。
接口
XAML
C#
The best method I've found is experimentation and guessing.
I created a little utility to visualize these colors.
Interface
XAML
C#
查看此 SystemColors 参考,特别是 Aero 主题颜色。
文本将使用哪种颜色名称并不明显,但尝试观察它,看起来
HighlightBrush
或MenuHighlightBrush
可能是候选者......Check out this SystemColors reference, and specifically the Aero Theme colors.
It's not obvious which color name that text would use, but trying to eyeball it, it looks like
HighlightBrush
orMenuHighlightBrush
could be candidates...用肉眼比较颜色是非常困难的!
如果您拍摄屏幕截图(键盘上的 Prt Scr 按钮),则可以将其粘贴到 mspaint 中并使用滴管获取实际的颜色值。
别名文本很棘手,但我读到屏幕截图中文本的颜色为 R,G,B=0,102,204,HotTrackColor 为 R,G,B = 0,102,203
正如我所说,差异可能是由于别名文本。
笔记:
使用滴管工具单击后,您可能需要选择“编辑颜色”才能查看实际的颜色值。反正win7下也可以。
It's very hard to compare colours by eye!
If you take a screen shot (Prt Scr button on your keyboard) you can then paste it into mspaint and use the eye dropper to get the actual colour values.
Tricky on the aliased text, but I read the colour of the text in the screenshot to be R,G,B=0,102,204 and HotTrackColor to be R,G,B = 0,102,203
As I say, the difference could be due to the aliasing on the text.
Note:
After clicking with the Eye Dropper Tool you might need to cilck "Edit colours" to see the actual colour values. You do in win7 anyway.