Files
GLEGram-iOS/submodules/LegacyComponents/Sources/TGColor.m
T
Leeksov 4647310322 GLEGram 12.5 — Initial public release
Based on Swiftgram 12.5 (Telegram iOS 12.5).
All GLEGram features ported and organized in GLEGram/ folder.

Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass,
Font Replacement, Fake Profile, Chat Export, Plugin System, and more.

See CHANGELOG_12.5.md for full details.
2026-04-06 09:48:12 +03:00

59 lines
1.4 KiB
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];
}
UIColor *TGAccentColor()
{
static UIColor *color = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^
{
color = TGColorWithHex(0x0088ff);
});
return color;
}
UIColor *TGDestructiveAccentColor()
{
static UIColor *color = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^
{
color = TGColorWithHex(0xff3b30);
});
return color;
}
UIColor *TGSelectionColor()
{
static UIColor *color = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
color = TGColorWithHex(0xe4e4e4);
else
color = TGColorWithHex(0xd9d9d9);
});
return color;
}
UIColor *TGSeparatorColor()
{
static UIColor *color = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^
{
color = TGColorWithHex(0xc8c7cc);
});
return color;
}