Mac OS X Finder 如何确定header 颜色?
How does Mac OS X Finder determine header color?
我正在使用 Cocoa/Objective-C 设计一个 table-like 控件。因为我想在 Mac 上模拟 Finder 的外观,所以我在绘制 table.
时检索系统颜色
特别是,对 table 行使用 [NSColor controlAlternatingRowBackgroundColors]
,我认为这看起来相当不错。但是,当谈到 table header 时,我有一些问题:
[NSColor headerTextColor]
产生黑色(这对我来说很好,因为 Finder 的 header 字幕也是黑色的),但我希望 [NSColor headerColor]
产生一种颜色文本可以很好地阅读。但是,[NSColor headerColor]
会产生非常暗的灰色 - 明显不同于 Finder 的 header 颜色。
那么,headerColor
这么黑正常吗? Finder 如何确定其 header 颜色(甚至有记录)?
Table 在 Finder 中查看 headers 从 Mac OS X 10.0 之前就不是纯色了。首先,它们是 "lickable" 水蓝色(或白色,未选择)渐变,然后随着时间的推移它们变得更加平坦,并且自 Yosemite (10.10) 以来,它们使用了开发人员可以使用的模糊半透明效果作为 NSVisualEffectView
。
无论如何,headerColor
和其他几种 NSColor
系统颜色(如 gridColor
)不会反映当前的 UI 设计。可能值得 filing a bug to Apple 弃用这些方法,在文档中准确提及哪些颜色仍在用于什么,或两者兼而有之。
如果您想要 headers 匹配 Finder,并且您没有使用 NSTableView
(免费获取它们),NSVisualEffectView
可能就是您想要的。
我正在使用 Cocoa/Objective-C 设计一个 table-like 控件。因为我想在 Mac 上模拟 Finder 的外观,所以我在绘制 table.
时检索系统颜色特别是,对 table 行使用 [NSColor controlAlternatingRowBackgroundColors]
,我认为这看起来相当不错。但是,当谈到 table header 时,我有一些问题:
[NSColor headerTextColor]
产生黑色(这对我来说很好,因为 Finder 的 header 字幕也是黑色的),但我希望 [NSColor headerColor]
产生一种颜色文本可以很好地阅读。但是,[NSColor headerColor]
会产生非常暗的灰色 - 明显不同于 Finder 的 header 颜色。
那么,headerColor
这么黑正常吗? Finder 如何确定其 header 颜色(甚至有记录)?
Table 在 Finder 中查看 headers 从 Mac OS X 10.0 之前就不是纯色了。首先,它们是 "lickable" 水蓝色(或白色,未选择)渐变,然后随着时间的推移它们变得更加平坦,并且自 Yosemite (10.10) 以来,它们使用了开发人员可以使用的模糊半透明效果作为 NSVisualEffectView
。
无论如何,headerColor
和其他几种 NSColor
系统颜色(如 gridColor
)不会反映当前的 UI 设计。可能值得 filing a bug to Apple 弃用这些方法,在文档中准确提及哪些颜色仍在用于什么,或两者兼而有之。
如果您想要 headers 匹配 Finder,并且您没有使用 NSTableView
(免费获取它们),NSVisualEffectView
可能就是您想要的。