Update LowContrastMode.xm
This commit is contained in:
parent
e1d4228ae0
commit
0b44e9c646
1 changed files with 20 additions and 5 deletions
|
|
@ -174,11 +174,14 @@ UIColor *lcmHexColor;
|
|||
%hook ELMTextNode
|
||||
- (void)updateAttributedText {
|
||||
%orig;
|
||||
NSMutableDictionary *attributes = [[self.attributedText attributesAtIndex:0 effectiveRange:NULL] mutableCopy];
|
||||
attributes[NSForegroundColorAttributeName] = [UIColor whiteColor];
|
||||
NSMutableAttributedString *modifiedText = [[NSMutableAttributedString alloc] initWithAttributedString:self.attributedText];
|
||||
[modifiedText setAttributes:attributes range:NSMakeRange(0, modifiedText.length)];
|
||||
self.attributedText = modifiedText;
|
||||
UILabel *label = nil;
|
||||
for (UIView *subview in self.subviews) {
|
||||
if ([subview isKindOfClass:[UILabel class]]) {
|
||||
label = (UILabel *)subview;
|
||||
break;
|
||||
}
|
||||
}
|
||||
label.textColor = [UIColor whiteColor];
|
||||
}
|
||||
%end
|
||||
%hook YCHLiveChatLabel
|
||||
|
|
@ -285,6 +288,18 @@ UIColor *lcmHexColor;
|
|||
}
|
||||
%end
|
||||
%hook ASTextNode
|
||||
- (void)setAttributedText:(NSAttributedString *)attributedText {
|
||||
%orig;
|
||||
NSMutableDictionary *attributes = [attributedText attributesAtIndex:0 effectiveRange:NULL].mutableCopy;
|
||||
attributes[NSForegroundColorAttributeName] = [UIColor whiteColor];
|
||||
NSMutableAttributedString *modifiedText = [[NSMutableAttributedString alloc] initWithAttributedString:attributedText];
|
||||
[modifiedText setAttributes:attributes range:NSMakeRange(0, modifiedText.length)];
|
||||
[self setAttributedText:modifiedText];
|
||||
}
|
||||
- (void)tintColorDidChange {
|
||||
%orig;
|
||||
self.textColorFollowsTintColor = NO;
|
||||
}
|
||||
- (NSAttributedString *)attributedString {
|
||||
NSAttributedString *originalAttributedString = %orig;
|
||||
NSMutableAttributedString *newAttributedString = [originalAttributedString mutableCopy];
|
||||
|
|
|
|||
Loading…
Reference in a new issue