Skip to content

Instantly share code, notes, and snippets.

@KATT
Created March 5, 2014 10:57
Show Gist options
  • Save KATT/9365131 to your computer and use it in GitHub Desktop.
Save KATT/9365131 to your computer and use it in GitHub Desktop.
// [..]
#define COLORGETTER(name, red, green, blue)\
+ (instancetype) name##Color\
{\
static UIColor *color = nil;\
static dispatch_once_t onceToken;\
dispatch_once(&onceToken, ^{\
color = RGB(red, green, blue);\
});\
return color;\
}
// [..]
COLORGETTER(piglet, 237.0, 0.0, 130.0); // -> + (instancetype) pigletColor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment