This commit is contained in:
Sebastian Imlay 2022-08-16 09:34:48 -04:00
parent a8e96836a2
commit e38d56ee42

View file

@ -247,13 +247,9 @@ impl Color {
let b = blue as CGFloat / 255.0;
let a = alpha as CGFloat / 255.0;
#[cfg(feature = "appkit")]
let ptr = unsafe {
Id::from_ptr(msg_send![class!(NSColor), colorWithCalibratedRed:r green:g blue:b alpha:a])
};
let ptr = unsafe { Id::from_ptr(msg_send![class!(NSColor), colorWithCalibratedRed:r green:g blue:b alpha:a]) };
#[cfg(all(feature = "uikit", not(feature = "appkit")))]
let ptr = unsafe {
Id::from_ptr(msg_send![class!(UIColor), colorWithRed:r green:g blue:b alpha:a])
};
let ptr = unsafe { Id::from_ptr(msg_send![class!(UIColor), colorWithRed:r green:g blue:b alpha:a]) };
Color::Custom(Arc::new(RwLock::new(ptr)))
}