23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
@implementation OFTaggedPointerColor
+ (void)initialize
{
if (self == [OFTaggedPointerColor class])
colorTag = objc_registerTaggedPointerClass(self);
}
+ (instancetype)colorWithRed: (uint8_t)red
green: (uint8_t)green
blue: (uint8_t)blue
{
return objc_createTaggedPointer(colorTag,
(uintptr_t)red << 16 | (uintptr_t)green << 8 | (uintptr_t)blue);
}
- (void)getRed: (float *)red
green: (float *)green
|
|
|
|
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
@implementation OFTaggedPointerColor
+ (void)initialize
{
if (self == [OFTaggedPointerColor class])
colorTag = objc_registerTaggedPointerClass(self);
}
+ (OFTaggedPointerColor *)colorWithRed: (uint8_t)red
green: (uint8_t)green
blue: (uint8_t)blue
{
return objc_createTaggedPointer(colorTag,
(uintptr_t)red << 16 | (uintptr_t)green << 8 | (uintptr_t)blue);
}
- (void)getRed: (float *)red
green: (float *)green
|