Merge branch 'feature/isDark' into 'develop'

added color extension for isDark

### Summary
(a brief description of the change)

### JIRA Ticket
(ticket URL here or remove the section)

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/998
This commit is contained in:
Pfeil, Scott Robert 2023-09-27 20:57:28 +00:00
commit 451b073718
2 changed files with 10 additions and 0 deletions

View File

@ -183,8 +183,12 @@
// Returns a gradient lighter color;
+ (nonnull UIColor *)mfGradientColor:(nullable UIColor *)color;
// Returns if the color is dark or not
- (BOOL)isDark;
#pragma mark - Hex String
+ (nullable NSString *)hexStringForColor:(nonnull UIColor*)color;
+ (nonnull UIColor *)mfGetColorForHexWithTransparency:(nonnull NSString *)hexString;
@end

View File

@ -389,6 +389,12 @@
return [UIColor whiteColor];
}
- (BOOL)isDark {
CGFloat greyScale = 0;
[self getWhite:&greyScale alpha:nil];
return greyScale < 0.5;
}
#pragma mark - Hex String
+ (nullable NSString *)hexStringForColor:(nonnull UIColor*)color {