diff --git a/KVNProgress/Categories/UIColor+KVNContrast.m b/KVNProgress/Categories/UIColor+KVNContrast.m index 411bdb0..68712de 100644 --- a/KVNProgress/Categories/UIColor+KVNContrast.m +++ b/KVNProgress/Categories/UIColor+KVNContrast.m @@ -12,8 +12,9 @@ @implementation UIColor (KVNContrast) - (UIStatusBarStyle)statusBarStyleConstrastStyle { - const CGFloat *componentColors = CGColorGetComponents(self.CGColor); - CGFloat darknessScore = (((componentColors[0] * 255) * 299) + ((componentColors[1] * 255) * 587) + ((componentColors[2] * 255) * 114)) / 1000; + CGFloat red, green, blue; + [self getRed:&red green:&green blue:&blue alpha:nil]; + CGFloat darknessScore = (((red * 255) * 299) + ((green * 255) * 587) + ((blue * 255) * 114)) / 1000; if (darknessScore >= 125) { return UIStatusBarStyleDefault;