From 1a57ad3231a90335cb2e7bd77ceb846992ff33f4 Mon Sep 17 00:00:00 2001 From: Pedro Paulo Jr Date: Thu, 5 May 2016 17:36:23 -0300 Subject: [PATCH] fix bug when using UIColor presets --- EZAudio/EZAudioUtilities.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/EZAudio/EZAudioUtilities.m b/EZAudio/EZAudioUtilities.m index 82402dad..a17fdec4 100644 --- a/EZAudio/EZAudioUtilities.m +++ b/EZAudio/EZAudioUtilities.m @@ -622,6 +622,17 @@ + (void)getColorComponentsFromCGColor:(CGColorRef)color *blue = components[2]; *alpha = components[3]; } + else if (componentCount == 2) + { + const CGFloat *components = CGColorGetComponents(color); + *red = components[0]; + *green = components[0]; + *blue = components[0]; + *alpha = components[1]; + } + else { + // should throw an exception maybe + } } //------------------------------------------------------------------------------