diff --git a/src/osx/core/colour.cpp b/src/osx/core/colour.cpp index e39d215cdc..7de9084fdc 100644 --- a/src/osx/core/colour.cpp +++ b/src/osx/core/colour.cpp @@ -70,14 +70,11 @@ void wxColour::InitRGBA (ChannelType r, ChannelType g, ChannelType b, ChannelTyp CGColorRef col = 0 ; #if wxOSX_USE_COCOA_OR_CARBON - if ( CGColorCreateGenericRGB != NULL ) - col = CGColorCreateGenericRGB( (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) ); - else + col = CGColorCreateGenericRGB( (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) ); +#else + CGFloat components[4] = { (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) } ; + col = CGColorCreate( wxMacGetGenericRGBColorSpace() , components ) ; #endif - { - CGFloat components[4] = { (CGFloat)(r / 255.0), (CGFloat) (g / 255.0), (CGFloat) (b / 255.0), (CGFloat) (a / 255.0) } ; - col = CGColorCreate( wxMacGetGenericRGBColorSpace() , components ) ; - } wxASSERT_MSG(col != NULL, "Invalid CoreGraphics Color"); m_cgColour.reset( col ); }