typo and cleanup

This commit is contained in:
Balackburn
2023-07-04 00:43:58 +02:00
parent 6cf9eabe9e
commit 261574c146

View File

@@ -306,13 +306,13 @@ BOOL areColorsEqual(UIColor *color1, UIColor *color2, CGFloat tolerance) {
// Open link with... // Open link with...
%hook ASWAppSwitchingSheetHeaderView %hook ASWAppSwitchingSheetHeaderView
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig(raisedColor) : %orig; return isDarkMode() ? %orig(customColor) : %orig;
} }
%end %end
%hook ASWAppSwitchingSheetFooterView %hook ASWAppSwitchingSheetFooterView
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
return isDarkMode() ? %orig(raisedColor) : %orig; return isDarkMode() ? %orig(customColor) : %orig;
} }
%end %end
@@ -320,14 +320,16 @@ BOOL areColorsEqual(UIColor *color1, UIColor *color2, CGFloat tolerance) {
- (void)didMoveToWindow { - (void)didMoveToWindow {
%orig; %orig;
if (isDarkMode()) { if (isDarkMode()) {
self.backgroundColor = raisedColor; self.backgroundColor = customColor;
self.subviews[1].backgroundColor = raisedColor; self.subviews[1].backgroundColor = customColor;
self.superview.backgroundColor = raisedColor; self.superview.backgroundColor = customColor;
} }
} }
%end %end
%end
// OLED dark mode by BandarHL // OLED dark mode by BandarHL
UIColor* raisedColor = [UIColor blackColor];
%group gOLED %group gOLED
%hook YTCommonColorPalette %hook YTCommonColorPalette
- (UIColor *)brandBackgroundSolid { - (UIColor *)brandBackgroundSolid {
@@ -380,17 +382,6 @@ BOOL areColorsEqual(UIColor *color1, UIColor *color2, CGFloat tolerance) {
} }
%end %end
BOOL areColorsEqual(UIColor *color1, UIColor *color2, CGFloat tolerance) {
CGFloat r1, g1, b1, a1, r2, g2, b2, a2;
[color1 getRed:&r1 green:&g1 blue:&b1 alpha:&a1];
[color2 getRed:&r2 green:&g2 blue:&b2 alpha:&a2];
return (fabs(r1 - r2) <= tolerance) &&
(fabs(g1 - g2) <= tolerance) &&
(fabs(b1 - b2) <= tolerance) &&
(fabs(a1 - a2) <= tolerance);
}
%hook UIView %hook UIView
- (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color {
UIColor *targetColor = [UIColor colorWithRed:0.0588235 green:0.0588235 blue:0.0588235 alpha:1]; UIColor *targetColor = [UIColor colorWithRed:0.0588235 green:0.0588235 blue:0.0588235 alpha:1];