Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
x.y.z Release Notes (yyyy-MM-dd)
=============================================================

2.1.1 Release Notes (2026-06-04)
=============================================================

### Fixed

* Toned down the tapped tint color calculations from producing oversaturated colors.

2.1.0 Release Notes (2026-05-27)
=============================================================

Expand Down
2 changes: 1 addition & 1 deletion TORoundedButton.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'TORoundedButton'
s.version = '2.1.0'
s.version = '2.1.1'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A high-performance button control with rounded corners for iOS.'
s.homepage = 'https://github.com/TimOliver/TORoundedButton'
Expand Down
5 changes: 4 additions & 1 deletion TORoundedButton/TORoundedButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ IB_DESIGNABLE @interface TORoundedButton : UIControl
/// (Defaults to off with 1.0f).
@property (nonatomic, assign) IBInspectable CGFloat tappedTextAlpha;

/// Taking the default button background color apply a brightness offset for the tapped color
/// The color of the button's rounded background shape. Applied to `.solid` and `.glass` styles.
@property (nonatomic, strong, nullable) UIColor *tintColor;

/// Taking the default button background color apply a brightness offset for the tapped color
/// (Default is 0.25f. Set 0.0 for off).
@property (nonatomic, assign) IBInspectable CGFloat tappedTintColorBrightnessOffset;

Expand Down
12 changes: 12 additions & 0 deletions TORoundedButton/TORoundedButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ @implementation TORoundedButton {
UIImpactFeedbackGenerator *_impactGenerator;
}

// We redlared `tintColor` in the header to make it more obvious that's how
// you control the background color. Skip synthesizing any accessors in here.
@dynamic tintColor;

#pragma mark - View Creation -

- (instancetype)init {
Expand Down Expand Up @@ -734,6 +738,14 @@ - (UIColor *)_brightnessAdjustedColorWithColor:(UIColor *)color amount:(CGFloat)
brightnessAdd = 0.18f * amount;
}

// Greys and other near-neutral colours carry a meaningless hue plus a faint
// undertone (e.g. systemGray leans slightly blue). Boosting their saturation
// amplifies that undertone into a visible tint, so scale the hue/saturation
// changes by how saturated the source already is — leaving brightness alone.
const CGFloat colorfulness = fminf(s / 0.15f, 1.0f);
hueShift *= colorfulness;
satBoost *= colorfulness;

// Apply hue shift with wrapping
CGFloat newH = h + hueShift;
if (newH < 0.0f) { newH += 1.0f; }
Expand Down
Loading