NSColorList—— an ordered list of NSColor objects, identified by keys.

官方API说是利用K-V来管理颜色列表的。


是个clr文件,一般存在于以下目录中:
/System/Library/Colors
/Local/Library/Colors
~/Library/Colors


使用步骤:
Create a Color Palette
To create a Color Palette, go to the Interface Building, and select the first view you need to change the background color for. This is where you can start creating a new Palette if your designer gave you a color guide:
Getting the RGB Values
If you do need the RGB Color values for your code, just open up your Color Palette -> Select the Color you need RGB for -> Switch to the RGB Sliders tab to view the RGB values:
Notice at the end there than you can switch to other Color sliders as well to get the needed format for each color.

Sharing
Your new Color Palette is now located in your Library -> Colors directory:
One thing to note is that your Library directory is not visible by default on the Mac. You’ll have to follow these instructions to make your hidden files visible on your Mac.

You can now share this file with your team, including your designer. Once they place it into their Mac’s Colors directory, they will see it! The cool part about this is the Color Palette will be now be visible from any other application, including Photoshop. In fact, you can get your designer to populate the palette from Photoshop, and then send it out to the team. As long as each person adds the most updated Color Palette to their Colors directory, you can now all use it from the Interface Builder!



这在IB中很实用很方便,但是也有很多缺点:
1、不能在ios的代码中使用,只能在IB中使用。不过可以在OSX的代码中使用
2、clr变更后,使用过的XIB文件,不能够对应更新。(原因而已看一下ib文件的sourceCode就能看出来了 标签中使用的是RGB’而不是文件和name,所以文件变更时ib文件不会同步更新)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值