An iOS and macOS audio visualization framework built upon Core Audio useful for anyone doing real-time, low-latency audio processing and visualizations.
That supposed the CGColorSpaceRef returned by the UIColor was always kCGColorSpaceGenericRGB (see below)
- (void)setBackgroundColor:(id)backgroundColor
{
_backgroundColor = backgroundColor;
if (backgroundColor)
{
CGColorRef colorRef = [backgroundColor CGColor];
CGFloat red; CGFloat green; CGFloat blue; CGFloat alpha;
[EZAudioUtilities getColorComponentsFromCGColor:colorRef
red:&red
green:&green
blue:&blue
alpha:&alpha];
//
// Note! If you set the alpha to be 0 on mac for a transparent view
// the EZAudioPlotGL will make the superview layer-backed to make
// sure there is a surface to display itself on (or else you will get
// some pretty weird drawing glitches
//
#if !TARGET_OS_IPHONE
if (alpha == 0.0f)
{
[self.superview setWantsLayer:YES];
}
#endif
glClearColor(red, green, blue, alpha);
}
else
{
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
}
}
Notice that's not true when you pass as UIColor things like [UIColor whiteColor]
There was a bug that in some cases could have
glClearColor
set to undefined value.The cause of this bug is the method
That supposed the
CGColorSpaceRef
returned by theUIColor
was alwayskCGColorSpaceGenericRGB
(see below)Notice that's not true when you pass as
UIColor
things like[UIColor whiteColor]