//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
#[cfg(target_vendor = "apple")]
use objc2_core_graphics::*;
#[cfg(feature = "objc2-core-image")]
#[cfg(target_vendor = "apple")]
use objc2_core_image::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumberwithpatterncolorleakfix?language=objc)
#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithPatternColorLeakFix: NSAppKitVersion = 641.0 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolortype?language=objc)
// 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);
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorsystemeffect?language=objc)
// 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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSColor;
);

unsafe impl Send for NSColor {}

unsafe impl Sync for NSColor {}

extern_conformance!(
    unsafe impl NSCoding for NSColor {}
);

extern_conformance!(
    unsafe impl NSCopying for NSColor {}
);

unsafe impl CopyingHelper for NSColor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for NSColor {}
);

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

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

extern_conformance!(
    unsafe impl NSSecureCoding for NSColor {}
);

impl NSColor {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[cfg(all(feature = "NSColorSpace", feature = "objc2-core-foundation"))]
        #[unsafe(method(colorWithColorSpace:components:count:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithColorSpace_components_count(
            space: &NSColorSpace,
            components: NonNull<CGFloat>,
            number_of_components: NSInteger,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithSRGBRed:green:blue:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithSRGBRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithGenericGamma22White:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithGenericGamma22White_alpha(
            white: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithDisplayP3Red:green:blue:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithDisplayP3Red_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithWhite:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithWhite_alpha(white: CGFloat, alpha: CGFloat) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithRed:green:blue:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithHue:saturation:brightness:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithHue_saturation_brightness_alpha(
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(all(feature = "NSColorSpace", feature = "objc2-core-foundation"))]
        #[unsafe(method(colorWithColorSpace:hue:saturation:brightness:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithColorSpace_hue_saturation_brightness_alpha(
            space: &NSColorSpace,
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "NSColorList")]
        #[unsafe(method(colorWithCatalogName:colorName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithCatalogName_colorName(
            list_name: &NSColorListName,
            color_name: &NSColorName,
        ) -> Option<Retained<NSColor>>;

        #[cfg(feature = "NSColorList")]
        #[unsafe(method(colorNamed:bundle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorNamed_bundle(
            name: &NSColorName,
            bundle: Option<&NSBundle>,
        ) -> Option<Retained<NSColor>>;

        #[cfg(feature = "NSColorList")]
        #[unsafe(method(colorNamed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorNamed(name: &NSColorName) -> Option<Retained<NSColor>>;

        #[cfg(all(feature = "NSAppearance", feature = "NSColorList", feature = "block2"))]
        #[unsafe(method(colorWithName:dynamicProvider:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithName_dynamicProvider(
            color_name: Option<&NSColorName>,
            dynamic_provider: &block2::DynBlock<dyn Fn(NonNull<NSAppearance>) -> NonNull<NSColor>>,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithDeviceWhite:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithDeviceWhite_alpha(
            white: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithDeviceRed:green:blue:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithDeviceRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithDeviceHue:saturation:brightness:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithDeviceHue_saturation_brightness_alpha(
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithDeviceCyan:magenta:yellow:black:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithDeviceCyan_magenta_yellow_black_alpha(
            cyan: CGFloat,
            magenta: CGFloat,
            yellow: CGFloat,
            black: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithCalibratedWhite:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithCalibratedWhite_alpha(
            white: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithCalibratedRed:green:blue:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithCalibratedRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithCalibratedHue:saturation:brightness:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithCalibratedHue_saturation_brightness_alpha(
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Retained<NSColor>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(colorWithPatternImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithPatternImage(image: &NSImage) -> Retained<NSColor>;

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

        #[unsafe(method(colorUsingType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorUsingType(&self, r#type: NSColorType) -> Option<Retained<NSColor>>;

        #[cfg(feature = "NSColorSpace")]
        #[unsafe(method(colorUsingColorSpace:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorUsingColorSpace(
            &self,
            space: &NSColorSpace,
        ) -> Option<Retained<NSColor>>;

        #[unsafe(method(blackColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn blackColor() -> Retained<NSColor>;

        #[unsafe(method(darkGrayColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn darkGrayColor() -> Retained<NSColor>;

        #[unsafe(method(lightGrayColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn lightGrayColor() -> Retained<NSColor>;

        #[unsafe(method(whiteColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn whiteColor() -> Retained<NSColor>;

        #[unsafe(method(grayColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn grayColor() -> Retained<NSColor>;

        #[unsafe(method(redColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn redColor() -> Retained<NSColor>;

        #[unsafe(method(greenColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn greenColor() -> Retained<NSColor>;

        #[unsafe(method(blueColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn blueColor() -> Retained<NSColor>;

        #[unsafe(method(cyanColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn cyanColor() -> Retained<NSColor>;

        #[unsafe(method(yellowColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn yellowColor() -> Retained<NSColor>;

        #[unsafe(method(magentaColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn magentaColor() -> Retained<NSColor>;

        #[unsafe(method(orangeColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn orangeColor() -> Retained<NSColor>;

        #[unsafe(method(purpleColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn purpleColor() -> Retained<NSColor>;

        #[unsafe(method(brownColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn brownColor() -> Retained<NSColor>;

        #[unsafe(method(clearColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn clearColor() -> Retained<NSColor>;

        #[unsafe(method(labelColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn labelColor() -> Retained<NSColor>;

        #[unsafe(method(secondaryLabelColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn secondaryLabelColor() -> Retained<NSColor>;

        #[unsafe(method(tertiaryLabelColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn tertiaryLabelColor() -> Retained<NSColor>;

        #[unsafe(method(quaternaryLabelColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn quaternaryLabelColor() -> Retained<NSColor>;

        #[unsafe(method(quinaryLabelColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn quinaryLabelColor() -> Retained<NSColor>;

        /// Used for large scale images or subtle decorative elements; not for general foreground content.
        #[unsafe(method(linkColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn linkColor() -> Retained<NSColor>;

        #[unsafe(method(placeholderTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn placeholderTextColor() -> Retained<NSColor>;

        #[unsafe(method(windowFrameTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn windowFrameTextColor() -> Retained<NSColor>;

        #[unsafe(method(selectedMenuItemTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedMenuItemTextColor() -> Retained<NSColor>;

        #[unsafe(method(alternateSelectedControlTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn alternateSelectedControlTextColor() -> Retained<NSColor>;

        #[unsafe(method(headerTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn headerTextColor() -> Retained<NSColor>;

        #[unsafe(method(separatorColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn separatorColor() -> Retained<NSColor>;

        #[unsafe(method(gridColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn gridColor() -> Retained<NSColor>;

        #[unsafe(method(windowBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn windowBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(underPageBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn underPageBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(controlBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(selectedContentBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedContentBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(unemphasizedSelectedContentBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn unemphasizedSelectedContentBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(alternatingContentBackgroundColors))]
        #[unsafe(method_family = none)]
        pub unsafe fn alternatingContentBackgroundColors() -> Retained<NSArray<NSColor>>;

        #[unsafe(method(findHighlightColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn findHighlightColor() -> Retained<NSColor>;

        #[unsafe(method(textColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn textColor() -> Retained<NSColor>;

        #[unsafe(method(textBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn textBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(textInsertionPointColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn textInsertionPointColor() -> Retained<NSColor>;

        #[unsafe(method(selectedTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedTextColor() -> Retained<NSColor>;

        #[unsafe(method(selectedTextBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedTextBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(unemphasizedSelectedTextBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn unemphasizedSelectedTextBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(unemphasizedSelectedTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn unemphasizedSelectedTextColor() -> Retained<NSColor>;

        #[unsafe(method(controlColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlColor() -> Retained<NSColor>;

        #[unsafe(method(controlTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlTextColor() -> Retained<NSColor>;

        #[unsafe(method(selectedControlColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedControlColor() -> Retained<NSColor>;

        #[unsafe(method(selectedControlTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedControlTextColor() -> Retained<NSColor>;

        #[unsafe(method(disabledControlTextColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn disabledControlTextColor() -> Retained<NSColor>;

        #[unsafe(method(keyboardFocusIndicatorColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn keyboardFocusIndicatorColor() -> Retained<NSColor>;

        #[unsafe(method(scrubberTexturedBackgroundColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn scrubberTexturedBackgroundColor() -> Retained<NSColor>;

        #[unsafe(method(systemRedColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemRedColor() -> Retained<NSColor>;

        #[unsafe(method(systemGreenColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemGreenColor() -> Retained<NSColor>;

        #[unsafe(method(systemBlueColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemBlueColor() -> Retained<NSColor>;

        #[unsafe(method(systemOrangeColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemOrangeColor() -> Retained<NSColor>;

        #[unsafe(method(systemYellowColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemYellowColor() -> Retained<NSColor>;

        #[unsafe(method(systemBrownColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemBrownColor() -> Retained<NSColor>;

        #[unsafe(method(systemPinkColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemPinkColor() -> Retained<NSColor>;

        #[unsafe(method(systemPurpleColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemPurpleColor() -> Retained<NSColor>;

        #[unsafe(method(systemGrayColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemGrayColor() -> Retained<NSColor>;

        #[unsafe(method(systemTealColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemTealColor() -> Retained<NSColor>;

        #[unsafe(method(systemIndigoColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemIndigoColor() -> Retained<NSColor>;

        #[unsafe(method(systemMintColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemMintColor() -> Retained<NSColor>;

        #[unsafe(method(systemCyanColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemCyanColor() -> Retained<NSColor>;

        /// Fill colors for UI elements.
        /// These are meant to be used over the background colors, since their alpha component is less than 1.
        ///
        /// systemFillColor is appropriate for filling thin shapes, such as the track of a slider.
        #[unsafe(method(systemFillColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn systemFillColor() -> Retained<NSColor>;

        /// secondarySystemFillColor is appropriate for filling small-size shapes, such as the backing of a progress indicator.
        #[unsafe(method(secondarySystemFillColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn secondarySystemFillColor() -> Retained<NSColor>;

        /// tertiarySystemFillColor is appropriate for filling medium-size shapes,  such as the backing of a switch.
        #[unsafe(method(tertiarySystemFillColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn tertiarySystemFillColor() -> Retained<NSColor>;

        /// quaternarySystemFillColor is appropriate for filling large areas, such as a group box or tab pane.
        #[unsafe(method(quaternarySystemFillColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn quaternarySystemFillColor() -> Retained<NSColor>;

        /// quinarySystemFillColor is appropriate for filling large areas that require subtle emphasis, such as content of a form..
        #[unsafe(method(quinarySystemFillColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn quinarySystemFillColor() -> Retained<NSColor>;

        /// A dynamic color that reflects the user's current preferred accent color. This color automatically updates when the accent color preference changes. Do not make assumptions about the color space of this color, which may change across releases.
        #[unsafe(method(controlAccentColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlAccentColor() -> Retained<NSColor>;

        #[cfg(feature = "NSCell")]
        #[unsafe(method(currentControlTint))]
        #[unsafe(method_family = none)]
        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."]
        #[unsafe(method(colorForControlTint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorForControlTint(control_tint: NSControlTint) -> Retained<NSColor>;

        #[unsafe(method(highlightColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn highlightColor() -> Retained<NSColor>;

        #[unsafe(method(shadowColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn shadowColor() -> Retained<NSColor>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(highlightWithLevel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn highlightWithLevel(&self, val: CGFloat) -> Option<Retained<NSColor>>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(shadowWithLevel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn shadowWithLevel(&self, val: CGFloat) -> Option<Retained<NSColor>>;

        /// Returns a color representing the base color with a system defined effect applied to it. This color is safe to create before draw time, as the resolution of the final color only happens when being `-set`, retrieving its `CGColor`, resolving with `-colorWithType:`, etc. The return color type is `.named`.
        #[unsafe(method(colorWithSystemEffect:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithSystemEffect(
            &self,
            system_effect: NSColorSystemEffect,
        ) -> Retained<NSColor>;

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

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

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

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(blendedColorWithFraction:ofColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn blendedColorWithFraction_ofColor(
            &self,
            fraction: CGFloat,
            color: &NSColor,
        ) -> Option<Retained<NSColor>>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(colorWithAlphaComponent:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithAlphaComponent(&self, alpha: CGFloat) -> Retained<NSColor>;

        #[cfg(feature = "NSColorList")]
        /// * Methods to get various components of colors. Not all of the methods apply to all colors; if called, they raise. **
        #[unsafe(method(catalogNameComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn catalogNameComponent(&self) -> Retained<NSColorListName>;

        #[cfg(feature = "NSColorList")]
        #[unsafe(method(colorNameComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorNameComponent(&self) -> Retained<NSColorName>;

        #[unsafe(method(localizedCatalogNameComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedCatalogNameComponent(&self) -> Retained<NSString>;

        #[unsafe(method(localizedColorNameComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedColorNameComponent(&self) -> Retained<NSString>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(redComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn redComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(greenComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn greenComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(blueComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn blueComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(getRed:green:blue:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getRed_green_blue_alpha(
            &self,
            red: *mut CGFloat,
            green: *mut CGFloat,
            blue: *mut CGFloat,
            alpha: *mut CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(hueComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn hueComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(saturationComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn saturationComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(brightnessComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn brightnessComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(getHue:saturation:brightness:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getHue_saturation_brightness_alpha(
            &self,
            hue: *mut CGFloat,
            saturation: *mut CGFloat,
            brightness: *mut CGFloat,
            alpha: *mut CGFloat,
        );

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(whiteComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn whiteComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(getWhite:alpha:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getWhite_alpha(&self, white: *mut CGFloat, alpha: *mut CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(cyanComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn cyanComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(magentaComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn magentaComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(yellowComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn yellowComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(blackComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn blackComponent(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(getCyan:magenta:yellow:black:alpha:))]
        #[unsafe(method_family = none)]
        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")]
        #[unsafe(method(colorSpace))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorSpace(&self) -> Retained<NSColorSpace>;

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

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(getComponents:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getComponents(&self, components: NonNull<CGFloat>);

        #[cfg(feature = "NSImage")]
        #[unsafe(method(patternImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn patternImage(&self) -> Retained<NSImage>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(alphaComponent))]
        #[unsafe(method_family = none)]
        pub unsafe fn alphaComponent(&self) -> CGFloat;

        #[cfg(feature = "NSPasteboard")]
        #[unsafe(method(colorFromPasteboard:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorFromPasteboard(paste_board: &NSPasteboard) -> Option<Retained<NSColor>>;

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

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

        #[cfg(feature = "objc2-core-graphics")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(colorWithCGColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithCGColor(cg_color: &CGColor) -> Option<Retained<NSColor>>;

        #[cfg(feature = "objc2-core-graphics")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(CGColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn CGColor(&self) -> Retained<CGColor>;

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

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

/// Methods declared on superclass `NSObject`.
impl NSColor {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// NSDeprecated.
impl NSColor {
    extern_methods!(
        /// Historically used as the inner border highlight color for beveled buttons. No longer used.
        #[deprecated = "Use a color that matches the semantics being used, such as `separatorColor`"]
        #[unsafe(method(controlHighlightColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlHighlightColor() -> Retained<NSColor>;

        /// Historically used as the outer border highlight color for beveled buttons. No longer used.
        #[deprecated = "Use a color that matches the semantics being used, such as `separatorColor`"]
        #[unsafe(method(controlLightHighlightColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlLightHighlightColor() -> Retained<NSColor>;

        /// Historically used as the inner border shadow color for beveled buttons. No longer used.
        #[deprecated = "Use a color that matches the semantics being used, such as `separatorColor`"]
        #[unsafe(method(controlShadowColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlShadowColor() -> Retained<NSColor>;

        /// Historically used as the outer border shadow color for beveled buttons. No longer used.
        #[deprecated = "Use a color that matches the semantics being used, such as `separatorColor`"]
        #[unsafe(method(controlDarkShadowColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlDarkShadowColor() -> Retained<NSColor>;

        /// Historically used as the color of scroll bars. No longer used.
        #[deprecated = "Use NSScroller instead"]
        #[unsafe(method(scrollBarColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn scrollBarColor() -> Retained<NSColor>;

        /// Historically used as the color of scroll bar knobs. No longer used.
        #[deprecated = "Use NSScroller instead"]
        #[unsafe(method(knobColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn knobColor() -> Retained<NSColor>;

        /// Historically used as the color of scroll bar knobs being dragged. No longer used.
        #[deprecated = "Use NSScroller instead"]
        #[unsafe(method(selectedKnobColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedKnobColor() -> Retained<NSColor>;

        /// Historically used as the color of the window chrome, which is no longer able to be represented by a color. No longer used.
        #[deprecated = "Use NSVisualEffectMaterialTitlebar"]
        #[unsafe(method(windowFrameColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn windowFrameColor() -> Retained<NSColor>;

        /// Historically used as the color of selected menu items, which is no longer a color but a tinted blur effect. No longer used.
        #[deprecated = "Use NSVisualEffectMaterialSelection"]
        #[unsafe(method(selectedMenuItemColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedMenuItemColor() -> Retained<NSColor>;

        /// Historically used as the color of table headers, which is no longer a color but a tinted blur effect.
        #[deprecated = "Use NSVisualEffectMaterialHeaderView"]
        #[unsafe(method(headerColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn headerColor() -> Retained<NSColor>;

        /// The background color of selected content or text that is unemphasized. Older alias for +unemphasizedSelectedContentBackgroundColor and +unemphasizedSelectedTextBackgroundColor
        #[deprecated]
        #[unsafe(method(secondarySelectedControlColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn secondarySelectedControlColor() -> Retained<NSColor>;

        /// The background color of selected and emphasized (focused) content: table views rows, collection views, etc. Older alias for +selectedContentBackgroundColor
        #[deprecated]
        #[unsafe(method(alternateSelectedControlColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn alternateSelectedControlColor() -> Retained<NSColor>;

        /// The background colors for alternating content items: such as table view rows, collection view items. Older alias for +alternatingContentBackgroundColors
        #[deprecated]
        #[unsafe(method(controlAlternatingRowBackgroundColors))]
        #[unsafe(method_family = none)]
        pub unsafe fn controlAlternatingRowBackgroundColors() -> Retained<NSArray<NSColor>>;

        #[cfg(feature = "NSGraphics")]
        #[deprecated = "Use -type and NSColorType instead"]
        #[unsafe(method(colorSpaceName))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorSpaceName(&self) -> Retained<NSColorSpaceName>;

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

        #[cfg(feature = "NSGraphics")]
        #[deprecated = "Use -colorUsingType: or -colorUsingColorSpace: instead"]
        #[unsafe(method(colorUsingColorSpaceName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorUsingColorSpaceName(
            &self,
            name: &NSColorSpaceName,
        ) -> Option<Retained<NSColor>>;
    );
}

/// NSQuartzCoreAdditions.
impl NSColor {
    extern_methods!(
        #[cfg(feature = "objc2-core-image")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(colorWithCIColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorWithCIColor(color: &CIColor) -> Retained<NSColor>;
    );
}

mod private_CIColorNSAppKitAdditions {
    pub trait Sealed {}
}

/// Category "NSAppKitAdditions" on [`CIColor`].
#[doc(alias = "NSAppKitAdditions")]
pub unsafe trait CIColorNSAppKitAdditions:
    ClassType + Sized + private_CIColorNSAppKitAdditions::Sealed
{
    extern_methods!(
        #[unsafe(method(initWithColor:))]
        #[unsafe(method_family = init)]
        unsafe fn initWithColor(this: Allocated<Self>, color: &NSColor) -> Option<Retained<Self>>;
    );
}

#[cfg(feature = "objc2-core-image")]
#[cfg(target_vendor = "apple")]
impl private_CIColorNSAppKitAdditions::Sealed for CIColor {}
#[cfg(feature = "objc2-core-image")]
#[cfg(target_vendor = "apple")]
unsafe impl CIColorNSAppKitAdditions for CIColor {}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssystemcolorsdidchangenotification?language=objc)
    pub static NSSystemColorsDidChangeNotification: &'static NSNotificationName;
}
