1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-image")]
#[cfg(not(target_os = "watchos"))]
use objc2_core_image::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIColor;

    unsafe impl ClassType for UIColor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl Send for UIColor {}

unsafe impl Sync for UIColor {}

unsafe impl NSCoding for UIColor {}

unsafe impl NSCopying for UIColor {}

unsafe impl NSObjectProtocol for UIColor {}

unsafe impl NSSecureCoding for UIColor {}

extern_methods!(
    unsafe impl UIColor {
        #[method_id(@__retain_semantics Other colorWithWhite:alpha:)]
        pub unsafe fn colorWithWhite_alpha(white: CGFloat, alpha: CGFloat) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other colorWithHue:saturation:brightness:alpha:)]
        pub unsafe fn colorWithHue_saturation_brightness_alpha(
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other colorWithRed:green:blue:alpha:)]
        pub unsafe fn colorWithRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other colorWithDisplayP3Red:green:blue:alpha:)]
        pub unsafe fn colorWithDisplayP3Red_green_blue_alpha(
            display_p3_red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other colorWithPatternImage:)]
        pub unsafe fn colorWithPatternImage(image: &UIImage) -> Retained<UIColor>;

        #[cfg(feature = "objc2-core-image")]
        #[cfg(not(target_os = "watchos"))]
        #[method_id(@__retain_semantics Other colorWithCIColor:)]
        pub unsafe fn colorWithCIColor(ci_color: &CIColor) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Init initWithWhite:alpha:)]
        pub unsafe fn initWithWhite_alpha(
            this: Allocated<Self>,
            white: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Init initWithHue:saturation:brightness:alpha:)]
        pub unsafe fn initWithHue_saturation_brightness_alpha(
            this: Allocated<Self>,
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Init initWithRed:green:blue:alpha:)]
        pub unsafe fn initWithRed_green_blue_alpha(
            this: Allocated<Self>,
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Init initWithDisplayP3Red:green:blue:alpha:)]
        pub unsafe fn initWithDisplayP3Red_green_blue_alpha(
            this: Allocated<Self>,
            display_p3_red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Init initWithPatternImage:)]
        pub unsafe fn initWithPatternImage(
            this: Allocated<Self>,
            image: &UIImage,
        ) -> Retained<UIColor>;

        #[cfg(feature = "objc2-core-image")]
        #[cfg(not(target_os = "watchos"))]
        #[method_id(@__retain_semantics Init initWithCIColor:)]
        pub unsafe fn initWithCIColor(
            this: Allocated<Self>,
            ci_color: &CIColor,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other blackColor)]
        pub unsafe fn blackColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other darkGrayColor)]
        pub unsafe fn darkGrayColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other lightGrayColor)]
        pub unsafe fn lightGrayColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other whiteColor)]
        pub unsafe fn whiteColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other grayColor)]
        pub unsafe fn grayColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other redColor)]
        pub unsafe fn redColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other greenColor)]
        pub unsafe fn greenColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other blueColor)]
        pub unsafe fn blueColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other cyanColor)]
        pub unsafe fn cyanColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other yellowColor)]
        pub unsafe fn yellowColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other magentaColor)]
        pub unsafe fn magentaColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other orangeColor)]
        pub unsafe fn orangeColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other purpleColor)]
        pub unsafe fn purpleColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other brownColor)]
        pub unsafe fn brownColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other clearColor)]
        pub unsafe fn clearColor() -> Retained<UIColor>;

        #[method(set)]
        pub unsafe fn set(&self);

        #[method(setFill)]
        pub unsafe fn setFill(&self);

        #[method(setStroke)]
        pub unsafe fn setStroke(&self);

        #[method(getWhite:alpha:)]
        pub unsafe fn getWhite_alpha(&self, white: *mut CGFloat, alpha: *mut CGFloat) -> bool;

        #[method(getHue:saturation:brightness:alpha:)]
        pub unsafe fn getHue_saturation_brightness_alpha(
            &self,
            hue: *mut CGFloat,
            saturation: *mut CGFloat,
            brightness: *mut CGFloat,
            alpha: *mut CGFloat,
        ) -> bool;

        #[method(getRed:green:blue:alpha:)]
        pub unsafe fn getRed_green_blue_alpha(
            &self,
            red: *mut CGFloat,
            green: *mut CGFloat,
            blue: *mut CGFloat,
            alpha: *mut CGFloat,
        ) -> bool;

        #[method_id(@__retain_semantics Other colorWithAlphaComponent:)]
        pub unsafe fn colorWithAlphaComponent(&self, alpha: CGFloat) -> Retained<UIColor>;

        #[cfg(feature = "objc2-core-image")]
        #[cfg(not(target_os = "watchos"))]
        #[method_id(@__retain_semantics Other CIColor)]
        pub unsafe fn CIColor(&self) -> Retained<CIColor>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl UIColor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_methods!(
    /// UINSItemProvider
    unsafe impl UIColor {}
);

unsafe impl NSItemProviderReading for UIColor {}

unsafe impl NSItemProviderWriting for UIColor {}

extern_category!(
    /// Category "UIKitAdditions" on [`CIColor`].
    #[doc(alias = "UIKitAdditions")]
    pub unsafe trait CIColorUIKitAdditions {
        #[method_id(@__retain_semantics Init initWithColor:)]
        unsafe fn initWithColor(this: Allocated<Self>, color: &UIColor) -> Retained<Self>;
    }

    #[cfg(feature = "objc2-core-image")]
    #[cfg(not(target_os = "watchos"))]
    unsafe impl CIColorUIKitAdditions for CIColor {}
);

extern_methods!(
    /// UIColorNamedColors
    unsafe impl UIColor {
        #[method_id(@__retain_semantics Other colorNamed:)]
        pub unsafe fn colorNamed(name: &NSString) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UITraitCollection")]
        #[method_id(@__retain_semantics Other colorNamed:inBundle:compatibleWithTraitCollection:)]
        pub unsafe fn colorNamed_inBundle_compatibleWithTraitCollection(
            name: &NSString,
            bundle: Option<&NSBundle>,
            trait_collection: Option<&UITraitCollection>,
        ) -> Option<Retained<UIColor>>;
    }
);

extern_methods!(
    /// DynamicColors
    unsafe impl UIColor {
        #[cfg(all(feature = "UITraitCollection", feature = "block2"))]
        #[method_id(@__retain_semantics Other colorWithDynamicProvider:)]
        pub unsafe fn colorWithDynamicProvider(
            dynamic_provider: &block2::Block<
                dyn Fn(NonNull<UITraitCollection>) -> NonNull<UIColor>,
            >,
        ) -> Retained<UIColor>;

        #[cfg(all(feature = "UITraitCollection", feature = "block2"))]
        #[method_id(@__retain_semantics Init initWithDynamicProvider:)]
        pub unsafe fn initWithDynamicProvider(
            this: Allocated<Self>,
            dynamic_provider: &block2::Block<
                dyn Fn(NonNull<UITraitCollection>) -> NonNull<UIColor>,
            >,
        ) -> Retained<UIColor>;

        #[cfg(feature = "UITraitCollection")]
        #[method_id(@__retain_semantics Other resolvedColorWithTraitCollection:)]
        pub unsafe fn resolvedColorWithTraitCollection(
            &self,
            trait_collection: &UITraitCollection,
        ) -> Retained<UIColor>;
    }
);