Lighter and Darker shade of a given UIColor in iOS

Mr.Javed Multani
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)…

--

--

Mr.Javed Multani

Software Engineer | Certified ScrumMaster® (CSM) | UX Researcher | Youtuber | Tech Writer