Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 31 lines (26 sloc) 0.72 kb
8a6043f @steipete initial commit
authored
1 //
2 // ColorUtils.h
3 //
4
5 #define HEXCOLOR(c) [UIColor colorWithRed:((c>>24)&0xFF)/255.0 \
6 green:((c>>16)&0xFF)/255.0 \
7 blue:((c>>8)&0xFF)/255.0 \
8 alpha:((c)&0xFF)/255.0];
9
10 // usage:
11 //UIColor* c = HEXCOLOR(0xff00ffff);
12
13 static float* HexToFloats(int c)
14 {
15 static float components[4];
16 components[0] = ((c>>24)&0xFF)/255.0;
17 components[1] = ((c>>16)&0xFF)/255.0;
18 components[2] = ((c>> 8)&0xFF)/255.0;
19 components[3] = ((c )&0xFF)/255.0;
20 return components;
21 }
22
23 // usage:
24 //CGContextSetStrokeColor(c, HexToFloats(0x808080ff));
25
26 @interface UIColor (UIColorUtils)
27 + (UIColor*)navigationColorForTab:(int)tab;
28 + (UIColor*)cellColorForTab:(int)tab;
29 + (UIColor*)cellLabelColor;
30 + (UIColor*)conversationBackground;
31 @end
Something went wrong with that request. Please try again.