Update LowContrastMode.xm

This commit is contained in:
arichornlover 2024-06-07 13:52:20 -05:00 committed by GitHub
parent 6b0c1424ea
commit f310fd4680
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,7 +13,7 @@ static BOOL customContrastMode() {
UIColor *lcmHexColor;
%group gLowContrastMode // Low Contrast Mode v1.5.2 (Compatible with only YouTube v17.33.2-v17.38.10)
%group gLowContrastMode // Low Contrast Mode v1.6.0 BETA (Compatible with only YouTube v17.33.2-v17.38.10)
%hook UIColor
+ (UIColor *)whiteColor { // Dark Theme Color
return [UIColor colorWithRed: 0.56 green: 0.56 blue: 0.56 alpha: 1.00];
@ -246,12 +246,21 @@ UIColor *lcmHexColor;
[modifiedAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
%orig(modifiedAttributes, state);
}
- (void)setCustomTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state {
NSMutableDictionary *customAttributes = [NSMutableDictionary dictionaryWithDictionary:attributes];
[customAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
%orig(customAttributes, state);
}
%end
%hook UIButton
- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state {
color = [UIColor whiteColor];
%orig(color, state);
}
- (void)setCustomTitleColor:(UIColor *)color forState:(UIControlState)state {
color = [UIColor whiteColor];
%orig(color, state);
}
%end
%hook UIBarButtonItem
- (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state {
@ -259,6 +268,11 @@ UIColor *lcmHexColor;
[modifiedAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
%orig(modifiedAttributes, state);
}
- (void)setCustomTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state {
NSMutableDictionary *customAttributes = [NSMutableDictionary dictionaryWithDictionary:attributes];
[customAttributes setObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
%orig(customAttributes, state);
}
%end
%hook NSAttributedString
- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary<NSAttributedStringKey, id> *)attrs {