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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
#[cfg(feature = "block2")]
use block2::*;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithPatternColorLeakFix: NSAppKitVersion = 641.0 as _;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSColorType(pub NSInteger);
impl NSColorType {
    #[doc(alias = "NSColorTypeComponentBased")]
    pub const ComponentBased: Self = Self(0);
    #[doc(alias = "NSColorTypePattern")]
    pub const Pattern: Self = Self(1);
    #[doc(alias = "NSColorTypeCatalog")]
    pub const Catalog: Self = Self(2);
}

unsafe impl Encode for NSColorType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSColorType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSColorSystemEffect(pub NSInteger);
impl NSColorSystemEffect {
    #[doc(alias = "NSColorSystemEffectNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "NSColorSystemEffectPressed")]
    pub const Pressed: Self = Self(1);
    #[doc(alias = "NSColorSystemEffectDeepPressed")]
    pub const DeepPressed: Self = Self(2);
    #[doc(alias = "NSColorSystemEffectDisabled")]
    pub const Disabled: Self = Self(3);
    #[doc(alias = "NSColorSystemEffectRollover")]
    pub const Rollover: Self = Self(4);
}

unsafe impl Encode for NSColorSystemEffect {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSColorSystemEffect {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

    unsafe impl ClassType for NSColor {
        type Super = NSObject;
        type Mutability = Immutable;
    }
);

unsafe impl Send for NSColor {}

unsafe impl Sync for NSColor {}

unsafe impl NSCoding for NSColor {}

unsafe impl NSCopying for NSColor {}

unsafe impl NSObjectProtocol for NSColor {}

#[cfg(feature = "NSPasteboard")]
unsafe impl NSPasteboardReading for NSColor {}

#[cfg(feature = "NSPasteboard")]
unsafe impl NSPasteboardWriting for NSColor {}

unsafe impl NSSecureCoding for NSColor {}

extern_methods!(
    unsafe impl NSColor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;

        #[cfg(feature = "NSColorSpace")]
        #[method_id(@__retain_semantics Other colorWithColorSpace:components:count:)]
        pub unsafe fn colorWithColorSpace_components_count(
            space: &NSColorSpace,
            components: NonNull<CGFloat>,
            number_of_components: NSInteger,
        ) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithSRGBRed:green:blue:alpha:)]
        pub unsafe fn colorWithSRGBRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithGenericGamma22White:alpha:)]
        pub unsafe fn colorWithGenericGamma22White_alpha(
            white: CGFloat,
            alpha: CGFloat,
        ) -> Id<NSColor>;

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

        #[method_id(@__retain_semantics Other colorWithWhite:alpha:)]
        pub unsafe fn colorWithWhite_alpha(white: CGFloat, alpha: CGFloat) -> Id<NSColor>;

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

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

        #[cfg(feature = "NSColorSpace")]
        #[method_id(@__retain_semantics Other colorWithColorSpace:hue:saturation:brightness:alpha:)]
        pub unsafe fn colorWithColorSpace_hue_saturation_brightness_alpha(
            space: &NSColorSpace,
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Id<NSColor>;

        #[cfg(feature = "NSColorList")]
        #[method_id(@__retain_semantics Other colorWithCatalogName:colorName:)]
        pub unsafe fn colorWithCatalogName_colorName(
            list_name: &NSColorListName,
            color_name: &NSColorName,
        ) -> Option<Id<NSColor>>;

        #[cfg(feature = "NSColorList")]
        #[method_id(@__retain_semantics Other colorNamed:bundle:)]
        pub unsafe fn colorNamed_bundle(
            name: &NSColorName,
            bundle: Option<&NSBundle>,
        ) -> Option<Id<NSColor>>;

        #[cfg(feature = "NSColorList")]
        #[method_id(@__retain_semantics Other colorNamed:)]
        pub unsafe fn colorNamed(name: &NSColorName) -> Option<Id<NSColor>>;

        #[cfg(all(feature = "NSAppearance", feature = "NSColorList", feature = "block2"))]
        #[method_id(@__retain_semantics Other colorWithName:dynamicProvider:)]
        pub unsafe fn colorWithName_dynamicProvider(
            color_name: Option<&NSColorName>,
            dynamic_provider: &Block<dyn Fn(NonNull<NSAppearance>) -> NonNull<NSColor>>,
        ) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithDeviceWhite:alpha:)]
        pub unsafe fn colorWithDeviceWhite_alpha(white: CGFloat, alpha: CGFloat) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithDeviceRed:green:blue:alpha:)]
        pub unsafe fn colorWithDeviceRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithDeviceHue:saturation:brightness:alpha:)]
        pub unsafe fn colorWithDeviceHue_saturation_brightness_alpha(
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithDeviceCyan:magenta:yellow:black:alpha:)]
        pub unsafe fn colorWithDeviceCyan_magenta_yellow_black_alpha(
            cyan: CGFloat,
            magenta: CGFloat,
            yellow: CGFloat,
            black: CGFloat,
            alpha: CGFloat,
        ) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithCalibratedWhite:alpha:)]
        pub unsafe fn colorWithCalibratedWhite_alpha(white: CGFloat, alpha: CGFloat)
            -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithCalibratedRed:green:blue:alpha:)]
        pub unsafe fn colorWithCalibratedRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other colorWithCalibratedHue:saturation:brightness:alpha:)]
        pub unsafe fn colorWithCalibratedHue_saturation_brightness_alpha(
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Id<NSColor>;

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

        #[method(type)]
        pub unsafe fn r#type(&self) -> NSColorType;

        #[method_id(@__retain_semantics Other colorUsingType:)]
        pub unsafe fn colorUsingType(&self, r#type: NSColorType) -> Option<Id<NSColor>>;

        #[cfg(feature = "NSColorSpace")]
        #[method_id(@__retain_semantics Other colorUsingColorSpace:)]
        pub unsafe fn colorUsingColorSpace(&self, space: &NSColorSpace) -> Option<Id<NSColor>>;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        #[method_id(@__retain_semantics Other labelColor)]
        pub unsafe fn labelColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other secondaryLabelColor)]
        pub unsafe fn secondaryLabelColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other tertiaryLabelColor)]
        pub unsafe fn tertiaryLabelColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other quaternaryLabelColor)]
        pub unsafe fn quaternaryLabelColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other quinaryLabelColor)]
        pub unsafe fn quinaryLabelColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other linkColor)]
        pub unsafe fn linkColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other placeholderTextColor)]
        pub unsafe fn placeholderTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other windowFrameTextColor)]
        pub unsafe fn windowFrameTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other selectedMenuItemTextColor)]
        pub unsafe fn selectedMenuItemTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other alternateSelectedControlTextColor)]
        pub unsafe fn alternateSelectedControlTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other headerTextColor)]
        pub unsafe fn headerTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other separatorColor)]
        pub unsafe fn separatorColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other gridColor)]
        pub unsafe fn gridColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other windowBackgroundColor)]
        pub unsafe fn windowBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other underPageBackgroundColor)]
        pub unsafe fn underPageBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other controlBackgroundColor)]
        pub unsafe fn controlBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other selectedContentBackgroundColor)]
        pub unsafe fn selectedContentBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other unemphasizedSelectedContentBackgroundColor)]
        pub unsafe fn unemphasizedSelectedContentBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other alternatingContentBackgroundColors)]
        pub unsafe fn alternatingContentBackgroundColors() -> Id<NSArray<NSColor>>;

        #[method_id(@__retain_semantics Other findHighlightColor)]
        pub unsafe fn findHighlightColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other textColor)]
        pub unsafe fn textColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other textBackgroundColor)]
        pub unsafe fn textBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other textInsertionPointColor)]
        pub unsafe fn textInsertionPointColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other selectedTextColor)]
        pub unsafe fn selectedTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other selectedTextBackgroundColor)]
        pub unsafe fn selectedTextBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other unemphasizedSelectedTextBackgroundColor)]
        pub unsafe fn unemphasizedSelectedTextBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other unemphasizedSelectedTextColor)]
        pub unsafe fn unemphasizedSelectedTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other controlColor)]
        pub unsafe fn controlColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other controlTextColor)]
        pub unsafe fn controlTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other selectedControlColor)]
        pub unsafe fn selectedControlColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other selectedControlTextColor)]
        pub unsafe fn selectedControlTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other disabledControlTextColor)]
        pub unsafe fn disabledControlTextColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other keyboardFocusIndicatorColor)]
        pub unsafe fn keyboardFocusIndicatorColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other scrubberTexturedBackgroundColor)]
        pub unsafe fn scrubberTexturedBackgroundColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemRedColor)]
        pub unsafe fn systemRedColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemGreenColor)]
        pub unsafe fn systemGreenColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemBlueColor)]
        pub unsafe fn systemBlueColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemOrangeColor)]
        pub unsafe fn systemOrangeColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemYellowColor)]
        pub unsafe fn systemYellowColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemBrownColor)]
        pub unsafe fn systemBrownColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemPinkColor)]
        pub unsafe fn systemPinkColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemPurpleColor)]
        pub unsafe fn systemPurpleColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemGrayColor)]
        pub unsafe fn systemGrayColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemTealColor)]
        pub unsafe fn systemTealColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemIndigoColor)]
        pub unsafe fn systemIndigoColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemMintColor)]
        pub unsafe fn systemMintColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemCyanColor)]
        pub unsafe fn systemCyanColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other systemFillColor)]
        pub unsafe fn systemFillColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other secondarySystemFillColor)]
        pub unsafe fn secondarySystemFillColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other tertiarySystemFillColor)]
        pub unsafe fn tertiarySystemFillColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other quaternarySystemFillColor)]
        pub unsafe fn quaternarySystemFillColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other quinarySystemFillColor)]
        pub unsafe fn quinarySystemFillColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other controlAccentColor)]
        pub unsafe fn controlAccentColor() -> Id<NSColor>;

        #[cfg(feature = "NSCell")]
        #[method(currentControlTint)]
        pub unsafe fn currentControlTint() -> NSControlTint;

        #[cfg(feature = "NSCell")]
        #[deprecated = "NSControlTint does not describe the full range of available control accent colors. Use +[NSColor controlAccentColor] instead."]
        #[method_id(@__retain_semantics Other colorForControlTint:)]
        pub unsafe fn colorForControlTint(control_tint: NSControlTint) -> Id<NSColor>;

        #[method_id(@__retain_semantics Other highlightColor)]
        pub unsafe fn highlightColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other shadowColor)]
        pub unsafe fn shadowColor() -> Id<NSColor>;

        #[method_id(@__retain_semantics Other highlightWithLevel:)]
        pub unsafe fn highlightWithLevel(&self, val: CGFloat) -> Option<Id<NSColor>>;

        #[method_id(@__retain_semantics Other shadowWithLevel:)]
        pub unsafe fn shadowWithLevel(&self, val: CGFloat) -> Option<Id<NSColor>>;

        #[method_id(@__retain_semantics Other colorWithSystemEffect:)]
        pub unsafe fn colorWithSystemEffect(
            &self,
            system_effect: NSColorSystemEffect,
        ) -> Id<NSColor>;

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

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

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

        #[method_id(@__retain_semantics Other blendedColorWithFraction:ofColor:)]
        pub unsafe fn blendedColorWithFraction_ofColor(
            &self,
            fraction: CGFloat,
            color: &NSColor,
        ) -> Option<Id<NSColor>>;

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

        #[cfg(feature = "NSColorList")]
        #[method_id(@__retain_semantics Other catalogNameComponent)]
        pub unsafe fn catalogNameComponent(&self) -> Id<NSColorListName>;

        #[cfg(feature = "NSColorList")]
        #[method_id(@__retain_semantics Other colorNameComponent)]
        pub unsafe fn colorNameComponent(&self) -> Id<NSColorName>;

        #[method_id(@__retain_semantics Other localizedCatalogNameComponent)]
        pub unsafe fn localizedCatalogNameComponent(&self) -> Id<NSString>;

        #[method_id(@__retain_semantics Other localizedColorNameComponent)]
        pub unsafe fn localizedColorNameComponent(&self) -> Id<NSString>;

        #[method(redComponent)]
        pub unsafe fn redComponent(&self) -> CGFloat;

        #[method(greenComponent)]
        pub unsafe fn greenComponent(&self) -> CGFloat;

        #[method(blueComponent)]
        pub unsafe fn blueComponent(&self) -> CGFloat;

        #[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,
        );

        #[method(hueComponent)]
        pub unsafe fn hueComponent(&self) -> CGFloat;

        #[method(saturationComponent)]
        pub unsafe fn saturationComponent(&self) -> CGFloat;

        #[method(brightnessComponent)]
        pub unsafe fn brightnessComponent(&self) -> CGFloat;

        #[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,
        );

        #[method(whiteComponent)]
        pub unsafe fn whiteComponent(&self) -> CGFloat;

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

        #[method(cyanComponent)]
        pub unsafe fn cyanComponent(&self) -> CGFloat;

        #[method(magentaComponent)]
        pub unsafe fn magentaComponent(&self) -> CGFloat;

        #[method(yellowComponent)]
        pub unsafe fn yellowComponent(&self) -> CGFloat;

        #[method(blackComponent)]
        pub unsafe fn blackComponent(&self) -> CGFloat;

        #[method(getCyan:magenta:yellow:black:alpha:)]
        pub unsafe fn getCyan_magenta_yellow_black_alpha(
            &self,
            cyan: *mut CGFloat,
            magenta: *mut CGFloat,
            yellow: *mut CGFloat,
            black: *mut CGFloat,
            alpha: *mut CGFloat,
        );

        #[cfg(feature = "NSColorSpace")]
        #[method_id(@__retain_semantics Other colorSpace)]
        pub unsafe fn colorSpace(&self) -> Id<NSColorSpace>;

        #[method(numberOfComponents)]
        pub unsafe fn numberOfComponents(&self) -> NSInteger;

        #[method(getComponents:)]
        pub unsafe fn getComponents(&self, components: NonNull<CGFloat>);

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Other patternImage)]
        pub unsafe fn patternImage(&self) -> Id<NSImage>;

        #[method(alphaComponent)]
        pub unsafe fn alphaComponent(&self) -> CGFloat;

        #[cfg(feature = "NSPasteboard")]
        #[method_id(@__retain_semantics Other colorFromPasteboard:)]
        pub unsafe fn colorFromPasteboard(paste_board: &NSPasteboard) -> Option<Id<NSColor>>;

        #[cfg(feature = "NSPasteboard")]
        #[method(writeToPasteboard:)]
        pub unsafe fn writeToPasteboard(&self, paste_board: &NSPasteboard);

        #[method(drawSwatchInRect:)]
        pub unsafe fn drawSwatchInRect(&self, rect: NSRect);

        #[deprecated = "Use `showsAlpha` in `NSColorPanel` and `supportsAlpha` in `NSColorWell` to control alpha behavior for individual controls."]
        #[method(ignoresAlpha)]
        pub unsafe fn ignoresAlpha(mtm: MainThreadMarker) -> bool;

        #[deprecated = "Use `showsAlpha` in `NSColorPanel` and `supportsAlpha` in `NSColorWell` to control alpha behavior for individual controls."]
        #[method(setIgnoresAlpha:)]
        pub unsafe fn setIgnoresAlpha(ignores_alpha: bool, mtm: MainThreadMarker);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSColor {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_methods!(
    /// NSDeprecated
    unsafe impl NSColor {
        #[deprecated = "Use a color that matches the semantics being used, such as `separatorColor`"]
        #[method_id(@__retain_semantics Other controlHighlightColor)]
        pub unsafe fn controlHighlightColor() -> Id<NSColor>;

        #[deprecated = "Use a color that matches the semantics being used, such as `separatorColor`"]
        #[method_id(@__retain_semantics Other controlLightHighlightColor)]
        pub unsafe fn controlLightHighlightColor() -> Id<NSColor>;

        #[deprecated = "Use a color that matches the semantics being used, such as `separatorColor`"]
        #[method_id(@__retain_semantics Other controlShadowColor)]
        pub unsafe fn controlShadowColor() -> Id<NSColor>;

        #[deprecated = "Use a color that matches the semantics being used, such as `separatorColor`"]
        #[method_id(@__retain_semantics Other controlDarkShadowColor)]
        pub unsafe fn controlDarkShadowColor() -> Id<NSColor>;

        #[deprecated = "Use NSScroller instead"]
        #[method_id(@__retain_semantics Other scrollBarColor)]
        pub unsafe fn scrollBarColor() -> Id<NSColor>;

        #[deprecated = "Use NSScroller instead"]
        #[method_id(@__retain_semantics Other knobColor)]
        pub unsafe fn knobColor() -> Id<NSColor>;

        #[deprecated = "Use NSScroller instead"]
        #[method_id(@__retain_semantics Other selectedKnobColor)]
        pub unsafe fn selectedKnobColor() -> Id<NSColor>;

        #[deprecated = "Use NSVisualEffectMaterialTitlebar"]
        #[method_id(@__retain_semantics Other windowFrameColor)]
        pub unsafe fn windowFrameColor() -> Id<NSColor>;

        #[deprecated = "Use NSVisualEffectMaterialSelection"]
        #[method_id(@__retain_semantics Other selectedMenuItemColor)]
        pub unsafe fn selectedMenuItemColor() -> Id<NSColor>;

        #[deprecated = "Use NSVisualEffectMaterialHeaderView"]
        #[method_id(@__retain_semantics Other headerColor)]
        pub unsafe fn headerColor() -> Id<NSColor>;

        #[deprecated]
        #[method_id(@__retain_semantics Other secondarySelectedControlColor)]
        pub unsafe fn secondarySelectedControlColor() -> Id<NSColor>;

        #[deprecated]
        #[method_id(@__retain_semantics Other alternateSelectedControlColor)]
        pub unsafe fn alternateSelectedControlColor() -> Id<NSColor>;

        #[deprecated]
        #[method_id(@__retain_semantics Other controlAlternatingRowBackgroundColors)]
        pub unsafe fn controlAlternatingRowBackgroundColors() -> Id<NSArray<NSColor>>;

        #[cfg(feature = "NSGraphics")]
        #[deprecated = "Use -type and NSColorType instead"]
        #[method_id(@__retain_semantics Other colorSpaceName)]
        pub unsafe fn colorSpaceName(&self) -> Id<NSColorSpaceName>;

        #[cfg(feature = "NSGraphics")]
        #[deprecated = "Use -colorUsingType: or -colorUsingColorSpace: instead"]
        #[method_id(@__retain_semantics Other colorUsingColorSpaceName:device:)]
        pub unsafe fn colorUsingColorSpaceName_device(
            &self,
            name: Option<&NSColorSpaceName>,
            device_description: Option<&NSDictionary<NSDeviceDescriptionKey, AnyObject>>,
        ) -> Option<Id<NSColor>>;

        #[cfg(feature = "NSGraphics")]
        #[deprecated = "Use -colorUsingType: or -colorUsingColorSpace: instead"]
        #[method_id(@__retain_semantics Other colorUsingColorSpaceName:)]
        pub unsafe fn colorUsingColorSpaceName(
            &self,
            name: &NSColorSpaceName,
        ) -> Option<Id<NSColor>>;
    }
);

extern_methods!(
    /// NSQuartzCoreAdditions
    unsafe impl NSColor {}
);

extern "C" {
    pub static NSSystemColorsDidChangeNotification: &'static NSNotificationName;
}