diff --git a/iOS/GBBackgroundView.m b/iOS/GBBackgroundView.m index 55ecac7..6b6c514 100644 --- a/iOS/GBBackgroundView.m +++ b/iOS/GBBackgroundView.m @@ -497,7 +497,7 @@ static GB_key_mask_t angleToKeyMask(double angle) if (@available(iOS 13.0, *)) { self.overrideUserInterfaceStyle = layout.theme.isDark? UIUserInterfaceStyleDark : UIUserInterfaceStyleLight; - self.tintColor = layout.theme.brandColor; + self.tintColor = layout.theme.buttonColor; } _screenLabel.frame = screenFrame; diff --git a/iOS/GBTheme.h b/iOS/GBTheme.h index e35ad59..884cd79 100644 --- a/iOS/GBTheme.h +++ b/iOS/GBTheme.h @@ -2,6 +2,7 @@ @interface GBTheme : NSObject @property (readonly, direct) UIColor *brandColor; +@property (readonly, direct) UIColor *buttonColor; @property (readonly, direct) UIColor *backgroundGradientTop; @property (readonly, direct) UIColor *backgroundGradientBottom; @property (readonly, direct) UIColor *bezelsGradientTop; diff --git a/iOS/GBTheme.m b/iOS/GBTheme.m index 8555c08..448b058 100644 --- a/iOS/GBTheme.m +++ b/iOS/GBTheme.m @@ -155,6 +155,16 @@ __attribute__((objc_direct_members)) } +- (UIColor *)buttonColor +{ + double r, g, b; + [_brandColor getRed:&r green:&g blue:&b alpha:NULL]; + if (r == 1.0 && g == 1.0 && b == 1.0) { + return _backgroundGradientTop; + } + return [UIColor colorWithRed:r green:g blue:b alpha:1.0]; +} + - (bool)isDark { double r, g, b; diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m index 281d8cd..530589a 100644 --- a/iOS/GBViewController.m +++ b/iOS/GBViewController.m @@ -229,7 +229,7 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp) [[GBHorizontalLayout alloc] initWithTheme:theme cutoutOnRight:true] : _horizontalLayoutLeft; _verticalLayout = [[GBVerticalLayout alloc] initWithTheme:theme]; - _printerSpinner.color = theme.brandColor; + _printerSpinner.color = theme.buttonColor; [self willRotateToInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation duration:0]; @@ -376,7 +376,7 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp) _printerButton = [[UIButton alloc] init]; _printerSpinner = [[UIActivityIndicatorView alloc] init]; _printerSpinner.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite; - _printerSpinner.color = _verticalLayout.theme.brandColor; + _printerSpinner.color = _verticalLayout.theme.buttonColor; [self didRotateFromInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation]; if (@available(iOS 13.0, *)) {