added color extension for isDark
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
b7a1cf6af6
commit
ab50921e88
@ -187,4 +187,8 @@
|
|||||||
|
|
||||||
+ (nullable NSString *)hexStringForColor:(nonnull UIColor*)color;
|
+ (nullable NSString *)hexStringForColor:(nonnull UIColor*)color;
|
||||||
+ (nonnull UIColor *)mfGetColorForHexWithTransparency:(nonnull NSString *)hexString;
|
+ (nonnull UIColor *)mfGetColorForHexWithTransparency:(nonnull NSString *)hexString;
|
||||||
|
|
||||||
|
// Returns if the color is dark or not
|
||||||
|
- (BOOL)isDark;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -403,4 +403,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isDark {
|
||||||
|
CGFloat greyScale = 0;
|
||||||
|
[self getWhite:&greyScale alpha:nil];
|
||||||
|
return greyScale < 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user