LowContrastMode v1.6.1

This commit is contained in:
aric3435 (INACTIVE) 2024-10-29 18:58:33 -05:00 committed by GitHub
parent e14bf4b655
commit 416dfec969
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,7 +16,7 @@ static BOOL customContrastMode() {
UIColor *lcmHexColor;
%group gLowContrastMode // Low Contrast Mode v1.6.0 BETA (Compatible with only YouTube v17.33.2-v17.38.10)
%group gLowContrastMode // Low Contrast Mode v1.6.1 (Compatible with only YouTube v17.33.2-v18.34.5)
%hook UIColor
+ (UIColor *)whiteColor { // Dark Theme Color
return [UIColor colorWithRed: 0.56 green: 0.56 blue: 0.56 alpha: 1.00];
@ -131,6 +131,38 @@ UIColor *lcmHexColor;
return [UIColor whiteColor];
}
%end
%hook _ASDisplayView
- (void)layoutSubviews {
%orig;
for (UIView *subview in self.subviews) {
if ([subview.accessibilityLabel isEqualToString:@"connect account"]) {
subview.backgroundColor = [UIColor whiteColor];
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
label.textColor = [UIColor blackColor];
}
} else if ([subview.accessibilityLabel isEqualToString:@"Thanks"]) {
subview.backgroundColor = [UIColor whiteColor];
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
label.textColor = [UIColor blackColor];
}
} else if ([subview.accessibilityLabel isEqualToString:@"Save to playlist"]) {
subview.backgroundColor = [UIColor whiteColor];
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
label.textColor = [UIColor blackColor];
}
} else if ([subview.accessibilityLabel isEqualToString:@"Report"]) {
subview.backgroundColor = [UIColor whiteColor];
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
label.textColor = [UIColor blackColor];
}
}
}
}
%end
%hook QTMColorGroup
- (UIColor *)tint100 {
return [UIColor whiteColor];
@ -434,6 +466,38 @@ UIColor *lcmHexColor;
return lcmHexColor;
}
%end
%hook _ASDisplayView
- (void)layoutSubviews {
%orig;
for (UIView *subview in self.subviews) {
if ([subview.accessibilityLabel isEqualToString:@"connect account"]) {
subview.backgroundColor = lcmHexColor;
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
label.textColor = [UIColor blackColor];
}
} else if ([subview.accessibilityLabel isEqualToString:@"Thanks"]) {
subview.backgroundColor = lcmHexColor;
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
label.textColor = [UIColor blackColor];
}
} else if ([subview.accessibilityLabel isEqualToString:@"Save to playlist"]) {
subview.backgroundColor = lcmHexColor;
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
label.textColor = [UIColor blackColor];
}
} else if ([subview.accessibilityLabel isEqualToString:@"Report"]) {
subview.backgroundColor = lcmHexColor;
if ([subview isKindOfClass:[UILabel class]]) {
UILabel *label = (UILabel *)subview;
label.textColor = [UIColor blackColor];
}
}
}
}
%end
%hook QTMColorGroup
- (UIColor *)tint100 {
return [UIColor whiteColor];