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

来源:互联网 发布:线切割锥度怎样编程 编辑:程序博客网 时间:2024/06/05 23:55

官方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