In ~/Library/Colors
you can find saved palette files created in OSX's color picker. What is the format of these files and how can they be created? The most I've been able to figure out is that they may be some sort of serialized NSObject data.
4 Answers
They are created by the NSColorList
class, documented here:
This site has a much better list of stuff you can do with color lists then Apples suspiciously austere offerings.
Included are…
- To Start Your Own Palette List
- To Give Your Palette a Meaningful Name
- To Add Colors to Your Palette List
- To Name the Colors in Your Palette List
- Finding Listed Colors by Name
- Finding Listed Colors by Color
- To Remove a Color from Your Palette List
- To Remove an Entire List
- To Open a Color Palette Stored on Your Hard Drive
- To Make a Backup of Your Color Palette
- To Arrange the Colors in the List (Don't get all excited; it's a tedious manual process.)
Personally I'm still after the frustratingly intangible holy Grail of getting the Pantone CLR files off of an old NeXt box. BIG ups to anyone that can snag those suckers. Crayons are for kids. HMMPH.
EDIT: Here is a simple example of how to create an NSColorList
NSColorList *list = [NSColorList.alloc initWithName:@"Pretty Colors"];
[ @{ @"mauve": [NSColor colorWithDeviceRed:.6 green:.6 blue:.5 alpha:1],
@"mustard": [NSColor colorWithDeviceRed:.6 green:.5 blue:.3 alpha:1],
@"poop-brown":[NSColor colorWithDeviceRed:.4 green:.4 blue:.1 alpha:1] }
enumerateKeysAndObjectsUsingBlock:^(id name, id color, BOOL *s) {
[list setColor:color forKey:name];
}];
-
2PS: i DID manage to snag the old Pantone clrs via a hodgepodge of vmware, openstep 4.2, virtual DOS floppies and a whole lotta luck.. verdict.. totally worth it for you daredevils.. and there ain't no way i'd cross the color gods at pantone by posting those babies here. but oooh, theyre good. Commented Jul 26, 2012 at 0:49
Also worth looking at Ramon Poca's ColorTools.
Html2Clr will convert a text file into a .clr
file.
eg: flag-colours.txt
#D90012 RED
#0033A0 BLUE
#F2A800 GOLD
Can be converted with:
./Html2Clr ./flag-colours.txt
To produce flag-colours.clr, once placed in ~/Library/Colors it will be available in the OSX colour picker.
You can create them by hand using the system color panel in any app, or programmatically using the NSColorList class.