Lighter and Darker shade of a given UIColor in iOS

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)…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mr.Javed Multani

Mr.Javed Multani

iOS Developer, Triple graduated, Passionate, Love workout, blogger