Wednesday, November 12, 2008

More Colors, More Compact

Whenever I have need of a new color in a project, I add new methods to my UIColor(MoreColors) category. I recently refactored it to be more compact and to require less typing to add a new color. I'm pulling the color names and definitions from Wikipedia.

Edit: I got tired of doing these piecemeal, so I decided to use awk to generate a category that includes all the colors that Wikipedia lists.

I'm normally not someone to skimp on vertical space, but compacting this just fell right, makes it more comprehensible. Consistency, after all, is the hobgoblin of little minds.

For those playing along at home, here is where it currently stands:

UIColor-MoreColors.h
//
// UIColor-MoreColors.h
//
// Created by Jeff LaMarche on 9/29/08.

#import <UIKit/UIKit.h>

@interface UIColor(MoreColors)
+ (id)aliceBlue;
+ (id)alizarin;
+ (id)amaranth;
+ (id)amber;
+ (id)amethyst;
+ (id)apricot;
+ (id)aqua;
+ (id)aquamarine;
+ (id)armyGreen;
+ (id)asparagus;
+ (id)atomicTangerine;
+ (id)auburn;
+ (id)azure;
+ (id)azureWeb;
+ (id)babyBlue;
+ (id)beige;
+ (id)bistre;
+ (id)black;
+ (id)blue;
+ (id)pigmentBlue;
+ (id)rybBlue;
+ (id)blueGreen;
+ (id)blueViolet;
+ (id)bondiBlue;
+ (id)brass;
+ (id)brightGreen;
+ (id)brightPink;
+ (id)brightTurquoise;
+ (id)brilliantRose;
+ (id)britishRacingGreen;
+ (id)bronze;
+ (id)brown;
+ (id)buff;
+ (id)burgundy;
+ (id)burntOrange;
+ (id)burntSienna;
+ (id)burntUmber;
+ (id)camouflageGreen;
+ (id)caputMortuum;
+ (id)cardinal;
+ (id)carmine;
+ (id)carnationPink;
+ (id)carolinaBlue;
+ (id)carrotOrange;
+ (id)celadon;
+ (id)cerise;
+ (id)cerulean;
+ (id)ceruleanBlue;
+ (id)champagne;
+ (id)charcoal;
+ (id)chartreuse;
+ (id)chartreuseWeb;
+ (id)cherryBlossomPink;
+ (id)chestnut;
+ (id)chocolate;
+ (id)cinnabar;
+ (id)cinnamon;
+ (id)cobalt;
+ (id)columbiaBlue;
+ (id)copper;
+ (id)copperRose;
+ (id)coral;
+ (id)coralRed;
+ (id)corn;
+ (id)cornflowerBlue;
+ (id)cosmicLatte;
+ (id)cream;
+ (id)crimson;
+ (id)cyan;
+ (id)processCyan;
+ (id)darkBlue;
+ (id)darkBrown;
+ (id)darkCerulean;
+ (id)darkChestnut;
+ (id)darkCoral;
+ (id)darkGoldenrod;
+ (id)darkGreen;
+ (id)darkKhaki;
+ (id)darkPastelGreen;
+ (id)darkPink;
+ (id)darkScarlet;
+ (id)darkSalmon;
+ (id)darkSlateGray;
+ (id)darkSpringGreen;
+ (id)darkTan;
+ (id)darkTurquoise;
+ (id)darkViolet;
+ (id)deepCerise;
+ (id)deepChestnut;
+ (id)deepFuchsia;
+ (id)deepLilac;
+ (id)deepMagenta;
+ (id)deepPeach;
+ (id)deepPink;
+ (id)denim;
+ (id)dodgerBlue;
+ (id)ecru;
+ (id)egyptianBlue;
+ (id)electricBlue;
+ (id)electricGreen;
+ (id)electricIndigo;
+ (id)electricLime;
+ (id)electricPurple;
+ (id)emerald;
+ (id)eggplant;
+ (id)faluRed;
+ (id)fernGreen;
+ (id)firebrick;
+ (id)flax;
+ (id)forestGreen;
+ (id)frenchRose;
+ (id)fuchsia;
+ (id)fuchsiaPink;
+ (id)gamboge;
+ (id)metallicGold;
+ (id)goldWeb;
+ (id)goldenBrown;
+ (id)goldenYellow;
+ (id)goldenrod;
+ (id)greyAsparagus;
+ (id)green;
+ (id)greenWeb;
+ (id)pigmentGreen;
+ (id)rybGreen;
+ (id)greenYellow;
+ (id)grey;
+ (id)hanPurple;
+ (id)harlequin;
+ (id)heliotrope;
+ (id)hollywoodCerise;
+ (id)hotMagenta;
+ (id)hotPink;
+ (id)indigo;
+ (id)indigoWeb;
+ (id)internationalKleinBlue;
+ (id)internationalOrange;
+ (id)islamicGreen;
+ (id)ivory;
+ (id)jade;
+ (id)kellyGreen;
+ (id)khaki;
+ (id)lightKhaki;
+ (id)lavender;
+ (id)lavenderWeb;
+ (id)lavenderBlue;
+ (id)lavenderBlush;
+ (id)lavenderGrey;
+ (id)lavenderMagenta;
+ (id)lavenderPink;
+ (id)lavenderPurple;
+ (id)lavenderRose;
+ (id)lawnGreen;
+ (id)lemon;
+ (id)lemonChiffon;
+ (id)lightBlue;
+ (id)lightPink;
+ (id)lilac;
+ (id)lime;
+ (id)limeWeb;
+ (id)limeGreen;
+ (id)linen;
+ (id)magenta;
+ (id)magentaDye;
+ (id)processMagenta;
+ (id)magicMint;
+ (id)magnolia;
+ (id)malachite;
+ (id)maroonWeb;
+ (id)maroon;
+ (id)mayaBlue;
+ (id)mauve;
+ (id)mauveTaupe;
+ (id)mediumBlue;
+ (id)mediumCarmine;
+ (id)mediumLavenderMagenta;
+ (id)mediumPurple;
+ (id)mediumSpringGreen;
+ (id)midnightBlue;
+ (id)mintGreen;
+ (id)mistyRose;
+ (id)mossGreen;
+ (id)mountbattenPink;
+ (id)mustard;
+ (id)myrtle;
+ (id)navajoWhite;
+ (id)navyBlue;
+ (id)ochre;
+ (id)officeGreen;
+ (id)oldGold;
+ (id)oldLace;
+ (id)oldLavender;
+ (id)oldRose;
+ (id)olive;
+ (id)oliveDrab;
+ (id)olivine;
+ (id)orange;
+ (id)rybOrange;
+ (id)orangeWeb;
+ (id)orangePeel;
+ (id)orangeRed;
+ (id)orchid;
+ (id)paleBlue;
+ (id)paleBrown;
+ (id)paleCarmine;
+ (id)paleChestnut;
+ (id)paleCornflowerBlue;
+ (id)paleMagenta;
+ (id)palePink;
+ (id)paleRedViolet;
+ (id)papayaWhip;
+ (id)pastelGreen;
+ (id)pastelPink;
+ (id)peach;
+ (id)peachOrange;
+ (id)peachYellow;
+ (id)pear;
+ (id)periwinkle;
+ (id)persianBlue;
+ (id)persianGreen;
+ (id)persianIndigo;
+ (id)persianOrange;
+ (id)persianRed;
+ (id)persianPink;
+ (id)persianRose;
+ (id)persimmon;
+ (id)pineGreen;
+ (id)pink;
+ (id)pinkOrange;
+ (id)platinum;
+ (id)plum;
+ (id)powderBlue;
+ (id)puce;
+ (id)prussianBlue;
+ (id)psychedelicPurple;
+ (id)pumpkin;
+ (id)purpleWeb;
+ (id)purple;
+ (id)purpleTaupe;
+ (id)rawUmber;
+ (id)razzmatazz;
+ (id)red;
+ (id)pigmentRed;
+ (id)rybRed;
+ (id)redBiolet;
+ (id)richCarmine;
+ (id)robinEggBlue;
+ (id)rose;
+ (id)roseMadder;
+ (id)roseTaupe;
+ (id)royalBlue;
+ (id)royalPurple;
+ (id)ruby;
+ (id)russet;
+ (id)rust;
+ (id)safetyOrange;
+ (id)blazeOrange;
+ (id)saffron;
+ (id)salmon;
+ (id)sandyBrown;
+ (id)sangria;
+ (id)sapphire;
+ (id)scarlet;
+ (id)schoolBusYellow;
+ (id)seaGreen;
+ (id)seashell;
+ (id)selectiveYellow;
+ (id)sepia;
+ (id)shamrockGreen;
+ (id)shockingPink;
+ (id)silver;
+ (id)skyBlue;
+ (id)slateGrey;
+ (id)smalt;
+ (id)springBud;
+ (id)springGreen;
+ (id)steelBlue;
+ (id)tan;
+ (id)tangerine;
+ (id)tangerineYellow;
+ (id)taupe;
+ (id)teaGreen;
+ (id)teaRoseOrange;
+ (id)teaRose;
+ (id)teal;
+ (id)tawny;
+ (id)terraCotta;
+ (id)thistle;
+ (id)tomato;
+ (id)turquoise;
+ (id)tyrianPurple;
+ (id)ultramarine;
+ (id)unitedNationsBlue;
+ (id)vegasGold;
+ (id)vermilion;
+ (id)violet;
+ (id)violetWeb;
+ (id)rybViolet;
+ (id)viridian;
+ (id)wheat;
+ (id)white;
+ (id)wisteria;
+ (id)yellow;
+ (id)processYellow;
+ (id)rybYellow;
+ (id)yellowGreen;
+ (id)zinnwaldite;
@end



UIColor-MoreColors.m
//
// UIColor-MoreColors.m
//
// Created by Jeff LaMarche on 9/29/08.

#import "UIColor-MoreColors.h"

#define vendColor(r, g, b) static UIColor *ret; if (ret == nil) ret = [[UIColor colorWithRed:(CGFloat)r/255.0 green:(CGFloat)g/255.0 blue:(CGFloat)b/255.0 alpha:1.0] retain]; return ret

@implementation UIColor(MoreColors)
+ (id)aliceBlue {vendColor(240, 248, 255);}
+ (id)alizarin {vendColor(227, 38, 54);}
+ (id)amaranth {vendColor(229, 43, 80);}
+ (id)amber {vendColor(255, 191, 0);}
+ (id)amethyst {vendColor(153, 102, 204);}
+ (id)apricot {vendColor(251, 206, 177);}
+ (id)aqua {vendColor(0, 255, 255);}
+ (id)aquamarine {vendColor(127, 255, 212);}
+ (id)armyGreen {vendColor(75, 83, 32);}
+ (id)asparagus {vendColor(123, 160, 91);}
+ (id)atomicTangerine {vendColor(255, 153, 102);}
+ (id)auburn {vendColor(111, 53, 26);}
+ (id)azure {vendColor(0, 127, 255);}
+ (id)azureWeb {vendColor(240, 255, 255);}
+ (id)babyBlue {vendColor(224, 255, 255);}
+ (id)beige {vendColor(245, 245, 220);}
+ (id)bistre {vendColor(61, 43, 31);}
+ (id)black {vendColor(0, 0, 0);}
+ (id)blue {vendColor(0, 0, 255);}
+ (id)pigmentBlue {vendColor(51, 51, 153);}
+ (id)rybBlue {vendColor(2, 71, 254);}
+ (id)blueGreen {vendColor(0, 223, 223);}
+ (id)blueViolet {vendColor(138, 43, 226);}
+ (id)bondiBlue {vendColor(0, 149, 182);}
+ (id)brass {vendColor(181, 166, 66);}
+ (id)brightGreen {vendColor(102, 255, 0);}
+ (id)brightPink {vendColor(255, 0, 127);}
+ (id)brightTurquoise {vendColor(8, 232, 222);}
+ (id)brilliantRose {vendColor(255, 85, 163);}
+ (id)britishRacingGreen {vendColor(0, 66, 37);}
+ (id)bronze {vendColor(205, 127, 50);}
+ (id)brown {vendColor(150, 75, 0);}
+ (id)buff {vendColor(240, 220, 130);}
+ (id)burgundy {vendColor(128, 0, 32);}
+ (id)burntOrange {vendColor(204, 85, 0);}
+ (id)burntSienna {vendColor(233, 116, 81);}
+ (id)burntUmber {vendColor(138, 51, 36);}
+ (id)camouflageGreen {vendColor(120, 134, 107);}
+ (id)caputMortuum {vendColor(89, 39, 32);}
+ (id)cardinal {vendColor(196, 30, 58);}
+ (id)carmine {vendColor(150, 0, 24);}
+ (id)carnationPink {vendColor(255, 166, 201);}
+ (id)carolinaBlue {vendColor(156, 186, 227);}
+ (id)carrotOrange {vendColor(237, 145, 33);}
+ (id)celadon {vendColor(172, 225, 175);}
+ (id)cerise {vendColor(222, 49, 99);}
+ (id)cerulean {vendColor(0, 123, 167);}
+ (id)ceruleanBlue {vendColor(42, 82, 190);}
+ (id)champagne {vendColor(247, 231, 206);}
+ (id)charcoal {vendColor(70, 70, 70);}
+ (id)chartreuse {vendColor(223, 255, 0);}
+ (id)chartreuseWeb {vendColor(127, 255, 0);}
+ (id)cherryBlossomPink {vendColor(255, 183, 197);}
+ (id)chestnut {vendColor(205, 92, 92);}
+ (id)chocolate {vendColor(123, 63, 0);}
+ (id)cinnabar {vendColor(227, 66, 52);}
+ (id)cinnamon {vendColor(210, 105, 30);}
+ (id)cobalt {vendColor(0, 71, 171);}
+ (id)columbiaBlue {vendColor(155, 221, 255);}
+ (id)copper {vendColor(184, 115, 51);}
+ (id)copperRose {vendColor(153, 102, 102);}
+ (id)coral {vendColor(255, 127, 80);}
+ (id)coralRed {vendColor(255, 64, 64);}
+ (id)corn {vendColor(251, 236, 93);}
+ (id)cornflowerBlue {vendColor(100, 149, 237);}
+ (id)cosmicLatte {vendColor(255, 248, 231);}
+ (id)cream {vendColor(255, 253, 208);}
+ (id)crimson {vendColor(220, 20, 60);}
+ (id)cyan {vendColor(0, 255, 255);}
+ (id)processCyan {vendColor(0, 180, 247);}
+ (id)darkBlue {vendColor(0, 0, 139);}
+ (id)darkBrown {vendColor(101, 67, 33);}
+ (id)darkCerulean {vendColor(8, 69, 126);}
+ (id)darkChestnut {vendColor(152, 105, 96);}
+ (id)darkCoral {vendColor(205, 91, 69);}
+ (id)darkGoldenrod {vendColor(184, 134, 11);}
+ (id)darkGreen {vendColor(1, 50, 32);}
+ (id)darkKhaki {vendColor(189, 183, 107);}
+ (id)darkPastelGreen {vendColor(3, 192, 60);}
+ (id)darkPink {vendColor(231, 84, 128);}
+ (id)darkScarlet {vendColor(86, 3, 125);}
+ (id)darkSalmon {vendColor(233, 150, 122);}
+ (id)darkSlateGray {vendColor(47, 79, 79);}
+ (id)darkSpringGreen {vendColor(23, 114, 69);}
+ (id)darkTan {vendColor(145, 129, 81);}
+ (id)darkTurquoise {vendColor(0, 206, 209);}
+ (id)darkViolet {vendColor(148, 0, 211);}
+ (id)deepCerise {vendColor(218, 50, 135);}
+ (id)deepChestnut {vendColor(185, 78, 72);}
+ (id)deepFuchsia {vendColor(193, 84, 193);}
+ (id)deepLilac {vendColor(153, 85, 187);}
+ (id)deepMagenta {vendColor(204, 0, 204);}
+ (id)deepPeach {vendColor(255, 203, 164);}
+ (id)deepPink {vendColor(255, 20, 147);}
+ (id)denim {vendColor(21, 96, 189);}
+ (id)dodgerBlue {vendColor(30, 144, 255);}
+ (id)ecru {vendColor(194, 178, 128);}
+ (id)egyptianBlue {vendColor(16, 52, 166);}
+ (id)electricBlue {vendColor(125, 249, 255);}
+ (id)electricGreen {vendColor(0, 255, 0);}
+ (id)electricIndigo {vendColor(102, 0, 255);}
+ (id)electricLime {vendColor(204, 255, 0);}
+ (id)electricPurple {vendColor(191, 0, 255);}
+ (id)emerald {vendColor(80, 200, 120);}
+ (id)eggplant {vendColor(97, 64, 81);}
+ (id)faluRed {vendColor(128, 24, 24);}
+ (id)fernGreen {vendColor(79, 121, 66);}
+ (id)firebrick {vendColor(178, 34, 34);}
+ (id)flax {vendColor(238, 220, 130);}
+ (id)forestGreen {vendColor(34, 139, 34);}
+ (id)frenchRose {vendColor(246, 74, 138);}
+ (id)fuchsia {vendColor(255, 0, 255);}
+ (id)fuchsiaPink {vendColor(255, 119, 255);}
+ (id)gamboge {vendColor(228, 155, 15);}
+ (id)metallicGold {vendColor(212, 175, 55);}
+ (id)goldWeb {vendColor(255, 215, 0);}
+ (id)goldenBrown {vendColor(153, 101, 21);}
+ (id)goldenYellow {vendColor(255, 223, 0);}
+ (id)goldenrod {vendColor(218, 165, 32);}
+ (id)greyAsparagus {vendColor(70, 89, 69);}
+ (id)green {vendColor(0, 255, 0);}
+ (id)greenWeb {vendColor(0, 128, 0);}
+ (id)pigmentGreen {vendColor(0, 165, 80);}
+ (id)rybGreen {vendColor(102, 176, 50);}
+ (id)greenYellow {vendColor(173, 255, 47);}
+ (id)grey {vendColor(128, 128, 128);}
+ (id)hanPurple {vendColor(82, 24, 250);}
+ (id)harlequin {vendColor(63, 255, 0);}
+ (id)heliotrope {vendColor(223, 115, 255);}
+ (id)hollywoodCerise {vendColor(244, 0, 161);}
+ (id)hotMagenta {vendColor(255, 0, 204);}
+ (id)hotPink {vendColor(255, 105, 180);}
+ (id)indigo {vendColor(0, 65, 106);}
+ (id)indigoWeb {vendColor(75, 0, 130);}
+ (id)internationalKleinBlue {vendColor(0, 47, 167);}
+ (id)internationalOrange {vendColor(255, 79, 0);}
+ (id)islamicGreen {vendColor(0, 153, 0);}
+ (id)ivory {vendColor(255, 255, 240);}
+ (id)jade {vendColor(0, 168, 107);}
+ (id)kellyGreen {vendColor(76, 187, 23);}
+ (id)khaki {vendColor(195, 176, 145);}
+ (id)lightKhaki {vendColor(240, 230, 140);}
+ (id)lavender {vendColor(181, 126, 220);}
+ (id)lavenderWeb {vendColor(230, 230, 250);}
+ (id)lavenderBlue {vendColor(204, 204, 255);}
+ (id)lavenderBlush {vendColor(255, 240, 245);}
+ (id)lavenderGrey {vendColor(196, 195, 221);}
+ (id)lavenderMagenta {vendColor(238, 130, 238);}
+ (id)lavenderPink {vendColor(251, 174, 210);}
+ (id)lavenderPurple {vendColor(150, 120, 182);}
+ (id)lavenderRose {vendColor(251, 160, 227);}
+ (id)lawnGreen {vendColor(124, 252, 0);}
+ (id)lemon {vendColor(253, 233, 16);}
+ (id)lemonChiffon {vendColor(255, 250, 205);}
+ (id)lightBlue {vendColor(173, 216, 230);}
+ (id)lightPink {vendColor(255, 182, 193);}
+ (id)lilac {vendColor(200, 162, 200);}
+ (id)lime {vendColor(191, 255, 0);}
+ (id)limeWeb {vendColor(0, 255, 0);}
+ (id)limeGreen {vendColor(50, 205, 50);}
+ (id)linen {vendColor(250, 240, 230);}
+ (id)magenta {vendColor(255, 0, 255);}
+ (id)magentaDye {vendColor(202, 31, 23);}
+ (id)processMagenta {vendColor(255, 0, 144);}
+ (id)magicMint {vendColor(170, 240, 209);}
+ (id)magnolia {vendColor(248, 244, 255);}
+ (id)malachite {vendColor(11, 218, 81);}
+ (id)maroonWeb {vendColor(128, 0, 0);}
+ (id)maroon {vendColor(176, 48, 96);}
+ (id)mayaBlue {vendColor(115, 194, 251);}
+ (id)mauve {vendColor(224, 176, 255);}
+ (id)mauveTaupe {vendColor(145, 95, 109);}
+ (id)mediumBlue {vendColor(0, 0, 205);}
+ (id)mediumCarmine {vendColor(175, 64, 53);}
+ (id)mediumLavenderMagenta {vendColor(204, 153, 204);}
+ (id)mediumPurple {vendColor(147, 112, 219);}
+ (id)mediumSpringGreen {vendColor(0, 250, 154);}
+ (id)midnightBlue {vendColor(0, 51, 102);}
+ (id)mintGreen {vendColor(152, 255, 152);}
+ (id)mistyRose {vendColor(255, 228, 225);}
+ (id)mossGreen {vendColor(173, 223, 173);}
+ (id)mountbattenPink {vendColor(153, 122, 141);}
+ (id)mustard {vendColor(255, 219, 88);}
+ (id)myrtle {vendColor(33, 66, 30);}
+ (id)navajoWhite {vendColor(255, 222, 173);}
+ (id)navyBlue {vendColor(0, 0, 128);}
+ (id)ochre {vendColor(204, 119, 34);}
+ (id)officeGreen {vendColor(0, 128, 0);}
+ (id)oldGold {vendColor(207, 181, 59);}
+ (id)oldLace {vendColor(253, 245, 230);}
+ (id)oldLavender {vendColor(121, 104, 120);}
+ (id)oldRose {vendColor(192, 46, 76);}
+ (id)olive {vendColor(128, 128, 0);}
+ (id)oliveDrab {vendColor(107, 142, 35);}
+ (id)olivine {vendColor(154, 185, 115);}
+ (id)orange {vendColor(255, 127, 0);}
+ (id)rybOrange {vendColor(251, 153, 2);}
+ (id)orangeWeb {vendColor(255, 165, 0);}
+ (id)orangePeel {vendColor(255, 160, 0);}
+ (id)orangeRed {vendColor(255, 69, 0);}
+ (id)orchid {vendColor(218, 112, 214);}
+ (id)paleBlue {vendColor(175, 238, 238);}
+ (id)paleBrown {vendColor(152, 118, 84);}
+ (id)paleCarmine {vendColor(175, 64, 53);}
+ (id)paleChestnut {vendColor(221, 173, 175);}
+ (id)paleCornflowerBlue {vendColor(171, 205, 239);}
+ (id)paleMagenta {vendColor(249, 132, 229);}
+ (id)palePink {vendColor(250, 218, 221);}
+ (id)paleRedViolet {vendColor(219, 112, 147);}
+ (id)papayaWhip {vendColor(255, 239, 213);}
+ (id)pastelGreen {vendColor(119, 221, 119);}
+ (id)pastelPink {vendColor(255, 209, 220);}
+ (id)peach {vendColor(255, 229, 180);}
+ (id)peachOrange {vendColor(255, 204, 153);}
+ (id)peachYellow {vendColor(250, 223, 173);}
+ (id)pear {vendColor(209, 226, 49);}
+ (id)periwinkle {vendColor(204, 204, 255);}
+ (id)persianBlue {vendColor(28, 57, 187);}
+ (id)persianGreen {vendColor(0, 166, 147);}
+ (id)persianIndigo {vendColor(50, 18, 122);}
+ (id)persianOrange {vendColor(217, 144, 88);}
+ (id)persianRed {vendColor(204, 51, 51);}
+ (id)persianPink {vendColor(247, 127, 190);}
+ (id)persianRose {vendColor(254, 40, 162);}
+ (id)persimmon {vendColor(236, 88, 0);}
+ (id)pineGreen {vendColor(1, 121, 111);}
+ (id)pink {vendColor(255, 192, 203);}
+ (id)pinkOrange {vendColor(255, 153, 102);}
+ (id)platinum {vendColor(229, 228, 226);}
+ (id)plum {vendColor(204, 153, 204);}
+ (id)powderBlue {vendColor(176, 224, 230);}
+ (id)puce {vendColor(204, 136, 153);}
+ (id)prussianBlue {vendColor(0, 49, 83);}
+ (id)psychedelicPurple {vendColor(221, 0, 255);}
+ (id)pumpkin {vendColor(255, 117, 24);}
+ (id)purpleWeb {vendColor(128, 0, 128);}
+ (id)purple {vendColor(160, 92, 240);}
+ (id)purpleTaupe {vendColor(80, 64, 77);}
+ (id)rawUmber {vendColor(115, 74, 18);}
+ (id)razzmatazz {vendColor(227, 11, 92);}
+ (id)red {vendColor(255, 0, 0);}
+ (id)pigmentRed {vendColor(237, 28, 36);}
+ (id)rybRed {vendColor(254, 39, 18);}
+ (id)redBiolet {vendColor(199, 21, 133);}
+ (id)richCarmine {vendColor(215, 0, 64);}
+ (id)robinEggBlue {vendColor(0, 204, 204);}
+ (id)rose {vendColor(255, 0, 127);}
+ (id)roseMadder {vendColor(227, 38, 54);}
+ (id)roseTaupe {vendColor(144, 93, 93);}
+ (id)royalBlue {vendColor(65, 105, 225);}
+ (id)royalPurple {vendColor(107, 63, 160);}
+ (id)ruby {vendColor(224, 17, 95);}
+ (id)russet {vendColor(128, 70, 27);}
+ (id)rust {vendColor(183, 65, 14);}
+ (id)safetyOrange {vendColor(255, 102, 0);}
+ (id)blazeOrange {vendColor(255, 102, 0);}
+ (id)saffron {vendColor(244, 196, 48);}
+ (id)salmon {vendColor(255, 140, 105);}
+ (id)sandyBrown {vendColor(244, 164, 96);}
+ (id)sangria {vendColor(146, 0, 10);}
+ (id)sapphire {vendColor(8, 37, 103);}
+ (id)scarlet {vendColor(255, 36, 0);}
+ (id)schoolBusYellow {vendColor(255, 216, 0);}
+ (id)seaGreen {vendColor(46, 139, 87);}
+ (id)seashell {vendColor(255, 245, 238);}
+ (id)selectiveYellow {vendColor(255, 186, 0);}
+ (id)sepia {vendColor(112, 66, 20);}
+ (id)shamrockGreen {vendColor(0, 158, 96);}
+ (id)shockingPink {vendColor(252, 15, 192);}
+ (id)silver {vendColor(192, 192, 192);}
+ (id)skyBlue {vendColor(135, 206, 235);}
+ (id)slateGrey {vendColor(112, 128, 144);}
+ (id)smalt {vendColor(0, 51, 153);}
+ (id)springBud {vendColor(167, 252, 0);}
+ (id)springGreen {vendColor(0, 255, 127);}
+ (id)steelBlue {vendColor(70, 130, 180);}
+ (id)tan {vendColor(210, 180, 140);}
+ (id)tangerine {vendColor(242, 133, 0);}
+ (id)tangerineYellow {vendColor(255, 204, 0);}
+ (id)taupe {vendColor(72, 60, 50);}
+ (id)teaGreen {vendColor(208, 240, 192);}
+ (id)teaRoseOrange {vendColor(248, 131, 194);}
+ (id)teaRose {vendColor(244, 194, 194);}
+ (id)teal {vendColor(0, 128, 128);}
+ (id)tawny {vendColor(205, 87, 0);}
+ (id)terraCotta {vendColor(226, 114, 91);}
+ (id)thistle {vendColor(216, 191, 216);}
+ (id)tomato {vendColor(255, 99, 71);}
+ (id)turquoise {vendColor(48, 213, 200);}
+ (id)tyrianPurple {vendColor(102, 2, 60);}
+ (id)ultramarine {vendColor(18, 10, 143);}
+ (id)unitedNationsBlue {vendColor(91, 146, 229);}
+ (id)vegasGold {vendColor(197, 179, 88);}
+ (id)vermilion {vendColor(227, 66, 51);}
+ (id)violet {vendColor(139, 0, 255);}
+ (id)violetWeb {vendColor(238, 130, 238);}
+ (id)rybViolet {vendColor(2, 71, 54);}
+ (id)viridian {vendColor(64, 130, 109);}
+ (id)wheat {vendColor(245, 222, 179);}
+ (id)white {vendColor(255, 255, 255);}
+ (id)wisteria {vendColor(201, 160, 220);}
+ (id)yellow {vendColor(255, 255, 0);}
+ (id)processYellow {vendColor(255, 239, 0);}
+ (id)rybYellow {vendColor(254, 254, 51);}
+ (id)yellowGreen {vendColor(154, 205, 50);}
+ (id)zinnwaldite {vendColor(235, 194, 175);}
@end





6 comments:

Peter N Lewis said...

I presume this code is Public Domain? Probably copyright would not apply anyway since it is basically just a list, but stating your intended license on posted code would be good. Thanks!

Jeff LaMarche said...

Peter:

I will post a clarification, but any code that I post here on my blog of course), is free for use for any purpose without restriction or limitation. If I post code that has a licenese, because, for example, it's based on code released under a viral license, I will make sure that is made clear in the posting.

And in regards to this code, since it's basically just a public domain list that's been reformatted into code, I agree that it would probably hard to protect.

Alice said...

How come so many common colors were left out?

Even many of the basic 147 "web colors supported by all browsers" aren't here at all.

AntiqueWhite #FAEBD7
Bisque #FFE4C4
BlanchedAlmond #FFEBCD
BurlyWood #DEB887
CadetBlue #5F9EA0
Cornsilk #FFF8DC
DarkCyan #008B8B
DarkGray #A9A9A9
DarkGrey #A9A9A9
DarkMagenta #8B008B
DarkOliveGreen #556B2F
DarkOrange #FF8C00
DarkOrchid #9932CC
DarkRed #8B0000
DarkSeaGreen #8FBC8F
DarkSlateBlue #483D8B
DarkSlateGrey #2F4F4F
DeepSkyBlue #00BFFF
DimGray #696969
DimGrey #696969
FloralWhite #FFFAF0
Gainsboro #DCDCDC
GhostWhite #F8F8FF
Gold #FFD700
HoneyDew #F0FFF0
IndianRed #CD5C5C
LightCoral #F08080
LightCyan #E0FFFF
LightGoldenRodYellow #FAFAD2
LightGray #D3D3D3
LightGreen #90EE90
LightGrey #D3D3D3
LightSalmon #FFA07A
LightSeaGreen #20B2AA
LightSkyBlue #87CEFA
LightSlateGray #778899
LightSlateGrey #778899
LightSteelBlue #B0C4DE
LightYellow #FFFFE0
MediumAquaMarine #66CDAA
MediumOrchid #BA55D3
MediumSeaGreen #3CB371
MediumSlateBlue #7B68EE
MediumTurquoise #48D1CC
MediumVioletRed #C71585
MintCream #F5FFFA
Moccasin #FFE4B5
Navy #000080
PaleGoldenRod #EEE8AA
PaleGreen #98FB98
PaleTurquoise #AFEEEE
PaleVioletRed #D87093
PeachPuff #FFDAB9
Peru #CD853F
RosyBrown #BC8F8F
SaddleBrown #8B4513
Sienna #A0522D
SlateBlue #6A5ACD
SlateGray #708090
Snow #FFFAFA
WhiteSmoke #F5F5F5

David Kendall said...

Add to UIColor-MoreColors.h

// Web Safe colors
+ (id)antiqueWhite;
+ (id)bisque;
+ (id)blanchedAlmond;
+ (id)burlyWood;
+ (id)cadetBlue;
+ (id)cornsilk;
+ (id)darkCyan;
+ (id)darkGray;
+ (id)darkGrey;
+ (id)darkMagenta;
+ (id)darkOliveGreen;
+ (id)darkOrange;
+ (id)darkOrchid;
+ (id)darkRed;
+ (id)darkSeaGreen;
+ (id)darkSlateBlue;
+ (id)darkSlateGrey;
+ (id)deepSkyBlue;
+ (id)dimGray;
+ (id)dimGrey;
+ (id)floralWhite;
+ (id)gainsboro;
+ (id)ghostWhite;
+ (id)hold;
+ (id)honeyDew;
+ (id)indianRed;
+ (id)lightCoral;
+ (id)lightCyan;
+ (id)lightGoldenRodYellow;
+ (id)lightGray;
+ (id)lightGreen;
+ (id)lightGrey;
+ (id)lightSalmon;
+ (id)lightSeaGreen;
+ (id)lightSkyBlue;
+ (id)lightSlateGrey;
+ (id)lightSteelBlue;
+ (id)lightYellow;
+ (id)mediumAquaMarine;
+ (id)mediumOrchid;
+ (id)mediumSeaGreen;
+ (id)mediumSlateBlue;
+ (id)mediumTurquoise;
+ (id)mediumVioletRed;
+ (id)mintCream;
+ (id)moccasin;
+ (id)navy;
+ (id)paleGoldenRod;
+ (id)paleGreen;
+ (id)paleTurquoise;
+ (id)paleVioletRed;
+ (id)peachPuff;
+ (id)peru;
+ (id)rosyBrown;
+ (id)saddleBrown;
+ (id)sienna;
+ (id)slateBlue;
+ (id)slateGray;
+ (id)snow;
+ (id)whiteSmoke;

David Kendall said...

Add to UIColors-MoreColors.m

#define vendColorHex(v) \
vendColor(((v&0xFF0000)>>16),((v&0x00FF00)>>8),(v&0x0000FF))


// Web Safe colors
+ (id)antiqueWhite {vendColorHex(0xFAEBD7);}
+ (id)bisque {vendColorHex(0xFFE4C4);}
+ (id)blanchedAlmond {vendColorHex(0xFFEBCD);}
+ (id)burlyWood {vendColorHex(0xDEB887);}
+ (id)cadetBlue {vendColorHex(0x5F9EA0);}
+ (id)cornsilk {vendColorHex(0xFFF8DC);}
+ (id)darkCyan {vendColorHex(0x008B8B);}
+ (id)darkGray {vendColorHex(0xA9A9A9);}
+ (id)darkGrey {vendColorHex(0xA9A9A9);}
+ (id)darkMagenta {vendColorHex(0x8B008B);}
+ (id)darkOliveGreen {vendColorHex(0x556B2F);}
+ (id)darkOrange {vendColorHex(0xFF8C00);}
+ (id)darkOrchid {vendColorHex(0x9932CC);}
+ (id)darkRed {vendColorHex(0x8B0000);}
+ (id)darkSeaGreen {vendColorHex(0x8FBC8F);}
+ (id)darkSlateBlue {vendColorHex(0x483D8B);}
+ (id)darkSlateGrey {vendColorHex(0x2F4F4F);}
+ (id)deepSkyBlue {vendColorHex(0x00BFFF);}
+ (id)dimGray {vendColorHex(0x696969);}
+ (id)dimGrey {vendColorHex(0x696969);}
+ (id)floralWhite {vendColorHex(0xFFFAF0);}
+ (id)gainsboro {vendColorHex(0xDCDCDC);}
+ (id)ghostWhite {vendColorHex(0xF8F8FF);}
+ (id)hold {vendColorHex(0xFFD700);}
+ (id)honeyDew {vendColorHex(0xF0FFF0);}
+ (id)indianRed {vendColorHex(0xCD5C5C);}
+ (id)lightCoral {vendColorHex(0xF08080);}
+ (id)lightCyan {vendColorHex(0xE0FFFF);}
+ (id)lightGoldenRodYellow {vendColorHex(0xFAFAD2);}

David Kendall said...

+ (id)lightGray {vendColorHex(0xD3D3D3);}
+ (id)lightGreen {vendColorHex(0x90EE90);}
+ (id)lightGrey {vendColorHex(0xD3D3D3);}
+ (id)lightSalmon {vendColorHex(0xFFA07A);}
+ (id)lightSeaGreen {vendColorHex(0x20B2AA);}
+ (id)lightSkyBlue {vendColorHex(0x87CEFA);}
+ (id)lightSlateGrey {vendColorHex(0x778899);}
+ (id)lightSteelBlue {vendColorHex(0xB0C4DE);}
+ (id)lightYellow {vendColorHex(0xFFFFE0);}
+ (id)mediumAquaMarine {vendColorHex(0x66CDAA);}
+ (id)mediumOrchid {vendColorHex(0xBA55D3);}
+ (id)mediumSeaGreen {vendColorHex(0x3CB371);}
+ (id)mediumSlateBlue {vendColorHex(0x7B68EE);}
+ (id)mediumTurquoise {vendColorHex(0x48D1CC);}
+ (id)mediumVioletRed {vendColorHex(0xC71585);}
+ (id)mintCream {vendColorHex(0xF5FFFA);}
+ (id)moccasin {vendColorHex(0xFFE4B5);}
+ (id)navy {vendColorHex(0x000080);}
+ (id)paleGoldenRod {vendColorHex(0xEEE8AA);}
+ (id)paleGreen {vendColorHex(0x98FB98);}
+ (id)paleTurquoise {vendColorHex(0xAFEEEE);}
+ (id)paleVioletRed {vendColorHex(0xD87093);}
+ (id)peachPuff {vendColorHex(0xFFDAB9);}
+ (id)peru {vendColorHex(0xCD853F);}
+ (id)rosyBrown {vendColorHex(0xBC8F8F);}
+ (id)saddleBrown {vendColorHex(0x8B4513);}
+ (id)sienna {vendColorHex(0xA0522D);}
+ (id)slateBlue {vendColorHex(0x6A5ACD);}
+ (id)slateGray {vendColorHex(0x708090);}
+ (id)snow {vendColorHex(0xFFFAFA);}
+ (id)whiteSmoke {vendColorHex(0xF5F5F5);}