Lighter and Darker shade of a given UIColor in iOS
1 min readOct 3, 2020
The code example below demonstrate how you can get a lighter and darker shade of a given color, useful in applications having dynamic themes
For Darker Color
+ (UIColor *)darkerColorForColor:(UIColor *)c
{CGFloat r, g, b, a;
if ([c getRed:&r green:&g blue:&b alpha:&a])return [UIColor colorWithRed:MAX(r - 0.2, 0.0)…