From 287edd0ad147b3a6244b6ecb17fdb9cdd9422e4e Mon Sep 17 00:00:00 2001 From: Timothy Costa Date: Wed, 9 Sep 2020 14:11:54 +0900 Subject: [PATCH] Fix warning 'conflicts with same method from another category' --- EDColor/UIColor+HSL.m | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/EDColor/UIColor+HSL.m b/EDColor/UIColor+HSL.m index e4c5b3c..97de968 100644 --- a/EDColor/UIColor+HSL.m +++ b/EDColor/UIColor+HSL.m @@ -37,9 +37,9 @@ - (UIColor *)offsetWithHue:(CGFloat)hue saturation:(CGFloat)saturation lightness // Calculate offsets hue = fmodf(hue + h, 1.0f); - saturation = [self clamp:(saturation + s)]; - lightness = [self clamp:(lightness + l)]; - alpha = [self clamp:(alpha + a)]; + saturation = clamp(saturation + s); + lightness = clamp(lightness + l); + alpha = clamp(alpha + a); return [UIColor colorWithHue:hue saturation:saturation lightness:lightness alpha:alpha]; } @@ -75,16 +75,16 @@ - (UIColor *)spin:(CGFloat)angle /** * Ternary clamp (0.0f to 1.0f) * - * @param {CGFloat} Input + * @param a Input * * @return {CGFloat} */ -- (CGFloat)clamp:(CGFloat)a +static CGFloat clamp (CGFloat a) { - static const CGFloat min = 0.0f; - static const CGFloat max = 1.0f; - - return (a > max) ? max : ((a < min) ? min : a); + static const CGFloat min = 0.0f; + static const CGFloat max = 1.0f; + + return (a > max) ? max : ((a < min) ? min : a); } /**