Struct objc2_ui_kit::UIColor
source · #[repr(C)]pub struct UIColor { /* private fields */ }
Available on crate feature
UIColor
only.Implementations§
source§impl UIColor
impl UIColor
UIAccessibility
pub unsafe fn accessibilityName(&self) -> Retained<NSString>
Available on crate feature
UIAccessibilityAdditions
only.source§impl UIColor
impl UIColor
pub unsafe fn colorWithWhite_alpha( white: CGFloat, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn colorWithHue_saturation_brightness_alpha( hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn colorWithRed_green_blue_alpha( red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn colorWithDisplayP3Red_green_blue_alpha( display_p3_red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn colorWithPatternImage(image: &UIImage) -> Retained<UIColor>
Available on crate feature
UIImage
only.pub unsafe fn colorWithCIColor(ci_color: &CIColor) -> Retained<UIColor>
Available on crate feature
objc2-core-image
and non-watchOS only.pub unsafe fn initWithWhite_alpha( this: Allocated<Self>, white: CGFloat, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn initWithHue_saturation_brightness_alpha( this: Allocated<Self>, hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn initWithRed_green_blue_alpha( this: Allocated<Self>, red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn initWithDisplayP3Red_green_blue_alpha( this: Allocated<Self>, display_p3_red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn initWithPatternImage( this: Allocated<Self>, image: &UIImage ) -> Retained<UIColor>
Available on crate feature
UIImage
only.pub unsafe fn initWithCIColor( this: Allocated<Self>, ci_color: &CIColor ) -> Retained<UIColor>
Available on crate feature
objc2-core-image
and non-watchOS only.pub unsafe fn blackColor() -> Retained<UIColor>
pub unsafe fn darkGrayColor() -> Retained<UIColor>
pub unsafe fn lightGrayColor() -> Retained<UIColor>
pub unsafe fn whiteColor() -> Retained<UIColor>
pub unsafe fn grayColor() -> Retained<UIColor>
pub unsafe fn redColor() -> Retained<UIColor>
pub unsafe fn greenColor() -> Retained<UIColor>
pub unsafe fn blueColor() -> Retained<UIColor>
pub unsafe fn cyanColor() -> Retained<UIColor>
pub unsafe fn yellowColor() -> Retained<UIColor>
pub unsafe fn magentaColor() -> Retained<UIColor>
pub unsafe fn orangeColor() -> Retained<UIColor>
pub unsafe fn purpleColor() -> Retained<UIColor>
pub unsafe fn brownColor() -> Retained<UIColor>
pub unsafe fn clearColor() -> Retained<UIColor>
pub unsafe fn set(&self)
pub unsafe fn setFill(&self)
pub unsafe fn setStroke(&self)
pub unsafe fn getWhite_alpha( &self, white: *mut CGFloat, alpha: *mut CGFloat ) -> bool
pub unsafe fn getHue_saturation_brightness_alpha( &self, hue: *mut CGFloat, saturation: *mut CGFloat, brightness: *mut CGFloat, alpha: *mut CGFloat ) -> bool
pub unsafe fn getRed_green_blue_alpha( &self, red: *mut CGFloat, green: *mut CGFloat, blue: *mut CGFloat, alpha: *mut CGFloat ) -> bool
pub unsafe fn colorWithAlphaComponent( &self, alpha: CGFloat ) -> Retained<UIColor>
pub unsafe fn CIColor(&self) -> Retained<CIColor>
Available on crate feature
objc2-core-image
and non-watchOS only.impl UIColor
This impl block contains no items.
UINSItemProvider
source§impl UIColor
impl UIColor
UIColorNamedColors
pub unsafe fn colorNamed(name: &NSString) -> Option<Retained<UIColor>>
pub unsafe fn colorNamed_inBundle_compatibleWithTraitCollection( name: &NSString, bundle: Option<&NSBundle>, trait_collection: Option<&UITraitCollection> ) -> Option<Retained<UIColor>>
Available on crate feature
UITraitCollection
only.source§impl UIColor
impl UIColor
DynamicColors
pub unsafe fn colorWithDynamicProvider( dynamic_provider: &Block<dyn Fn(NonNull<UITraitCollection>) -> NonNull<UIColor>> ) -> Retained<UIColor>
Available on crate features
UITraitCollection
and block2
only.pub unsafe fn initWithDynamicProvider( this: Allocated<Self>, dynamic_provider: &Block<dyn Fn(NonNull<UITraitCollection>) -> NonNull<UIColor>> ) -> Retained<UIColor>
Available on crate features
UITraitCollection
and block2
only.pub unsafe fn resolvedColorWithTraitCollection( &self, trait_collection: &UITraitCollection ) -> Retained<UIColor>
Available on crate feature
UITraitCollection
only.source§impl UIColor
impl UIColor
UIColorSystemColors
pub unsafe fn systemRedColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemGreenColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemBlueColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemOrangeColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemYellowColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemPinkColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemPurpleColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemTealColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemIndigoColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemBrownColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemMintColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemCyanColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemGrayColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemGray2Color() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemGray3Color() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemGray4Color() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemGray5Color() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemGray6Color() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn tintColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn labelColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn secondaryLabelColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn tertiaryLabelColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn quaternaryLabelColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn linkColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn placeholderTextColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn separatorColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn opaqueSeparatorColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemBackgroundColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn secondarySystemBackgroundColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn tertiarySystemBackgroundColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemGroupedBackgroundColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn secondarySystemGroupedBackgroundColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn tertiarySystemGroupedBackgroundColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn systemFillColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn secondarySystemFillColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn tertiarySystemFillColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn quaternarySystemFillColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn lightTextColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn darkTextColor() -> Retained<UIColor>
Available on crate feature
UIInterface
only.pub unsafe fn groupTableViewBackgroundColor() -> Retained<UIColor>
👎Deprecated
Available on crate feature
UIInterface
only.pub unsafe fn viewFlipsideBackgroundColor() -> Retained<UIColor>
👎Deprecated
Available on crate feature
UIInterface
only.pub unsafe fn scrollViewTexturedBackgroundColor() -> Retained<UIColor>
👎Deprecated
Available on crate feature
UIInterface
only.pub unsafe fn underPageBackgroundColor() -> Retained<UIColor>
👎Deprecated
Available on crate feature
UIInterface
only.Methods from Deref<Target = NSObject>§
sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
sourcepub fn class(&self) -> &'static AnyClass
Available on crate feature UIIndirectScribbleInteraction
only.
pub fn class(&self) -> &'static AnyClass
UIIndirectScribbleInteraction
only.Dynamically find the class of this object.
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.Available on crate feature UIIndirectScribbleInteraction
only.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.UIIndirectScribbleInteraction
only.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.Available on crate feature UIIndirectScribbleInteraction
only.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.UIIndirectScribbleInteraction
only.Use Ivar::load_mut
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Trait Implementations§
source§impl BorrowMut<AnyObject> for UIColor
impl BorrowMut<AnyObject> for UIColor
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for UIColor
impl BorrowMut<NSObject> for UIColor
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl ClassType for UIColor
impl ClassType for UIColor
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "UIColor"
const NAME: &'static str = "UIColor"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl NSItemProviderReading for UIColor
impl NSItemProviderReading for UIColor
source§impl NSItemProviderWriting for UIColor
impl NSItemProviderWriting for UIColor
source§unsafe fn writableTypeIdentifiersForItemProvider_class(
) -> Retained<NSArray<NSString>>
unsafe fn writableTypeIdentifiersForItemProvider_class( ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.source§unsafe fn writableTypeIdentifiersForItemProvider(
&self
) -> Retained<NSArray<NSString>>
unsafe fn writableTypeIdentifiersForItemProvider( &self ) -> Retained<NSArray<NSString>>
Available on crate features
NSArray
and NSString
only.source§unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier_class(
type_identifier: &NSString
) -> NSItemProviderRepresentationVisibility
unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier_class( type_identifier: &NSString ) -> NSItemProviderRepresentationVisibility
Available on crate feature
NSString
only.source§unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier(
&self,
type_identifier: &NSString
) -> NSItemProviderRepresentationVisibility
unsafe fn itemProviderVisibilityForRepresentationWithTypeIdentifier( &self, type_identifier: &NSString ) -> NSItemProviderRepresentationVisibility
Available on crate feature
NSString
only.source§impl NSObjectProtocol for UIColor
impl NSObjectProtocol for UIColor
source§fn isEqual(&self, other: &AnyObject) -> bool
fn isEqual(&self, other: &AnyObject) -> bool
Check whether the object is equal to an arbitrary other object. Read more
source§fn hash(&self) -> usize
fn hash(&self) -> usize
An integer that can be used as a table address in a hash table
structure. Read more
source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of the class, or one of its
subclasses. Read more
source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
Check if the object is an instance of the class type, or one of its
subclasses. Read more
source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of a specific class, without
checking subclasses. Read more
source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Check whether the object implements or inherits a method with the
given selector. Read more
source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Check whether the object conforms to a given protocol. Read more
source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl NSSecureCoding for UIColor
impl NSSecureCoding for UIColor
source§impl PartialEq for UIColor
impl PartialEq for UIColor
source§impl RefEncode for UIColor
impl RefEncode for UIColor
source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for UIColor
impl Message for UIColor
impl Send for UIColor
impl StructuralPartialEq for UIColor
impl Sync for UIColor
Auto Trait Implementations§
impl !Freeze for UIColor
impl !RefUnwindSafe for UIColor
impl !Unpin for UIColor
impl !UnwindSafe for UIColor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CounterpartOrSelf for T
impl<T> CounterpartOrSelf for T
§type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
The immutable counterpart of the type, or
Self
if the type has no
immutable counterpart. Read more§type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
The mutable counterpart of the type, or
Self
if the type has no
mutable counterpart. Read more