mirror of
https://github.com/danog/Telegram.git
synced 2024-12-03 09:57:46 +01:00
11 lines
425 B
Objective-C
11 lines
425 B
Objective-C
#import "TGColor.h"
|
|
|
|
UIColor *TGColorWithHex(int hex)
|
|
{
|
|
return [[UIColor alloc] initWithRed:(((hex >> 16) & 0xff) / 255.0f) green:(((hex >> 8) & 0xff) / 255.0f) blue:(((hex) & 0xff) / 255.0f) alpha:1.0f];
|
|
}
|
|
|
|
UIColor *TGColorWithHexAndAlpha(int hex, CGFloat alpha)
|
|
{
|
|
return [[UIColor alloc] initWithRed:(((hex >> 16) & 0xff) / 255.0f) green:(((hex >> 8) & 0xff) / 255.0f) blue:(((hex) & 0xff) / 255.0f) alpha:alpha];
|
|
} |