Class UIColor

All Implemented Interfaces:
NSCoding, NSItemProviderReading, NSItemProviderWriting, NSObjectProtocol, NSSecureCoding, ObjCProtocol

public class UIColor
extends NSObject
implements NSSecureCoding, NSItemProviderReading, NSItemProviderWriting
  • Constructor Details

    • UIColor

      public UIColor()
    • UIColor

      protected UIColor​(NSObject.Handle h, long handle)
    • UIColor

      protected UIColor​(NSObject.SkipInit skipInit)
    • UIColor

      public UIColor​(double red, double green, double blue, double alpha)
    • UIColor

      public UIColor​(CGColor cgColor)
    • UIColor

      public UIColor​(CIColor ciColor)
    • UIColor

      public UIColor​(Block1<UITraitCollection,​UIColor> dynamicProvider)
      Since:
      Available in iOS 13.0 and later.
    • UIColor

      public UIColor​(NSCoder coder)
  • Method Details

    • black

      public static UIColor black()
    • darkGray

      public static UIColor darkGray()
    • lightGray

      public static UIColor lightGray()
    • white

      public static UIColor white()
    • gray

      public static UIColor gray()
    • red

      public static UIColor red()
    • green

      public static UIColor green()
    • blue

      public static UIColor blue()
    • cyan

      public static UIColor cyan()
    • yellow

      public static UIColor yellow()
    • magenta

      public static UIColor magenta()
    • orange

      public static UIColor orange()
    • purple

      public static UIColor purple()
    • brown

      public static UIColor brown()
    • clear

      public static UIColor clear()
    • getCGColor

      public CGColor getCGColor()
    • getCIColor

      public CIColor getCIColor()
    • systemRed

      public static UIColor systemRed()
    • systemGreen

      public static UIColor systemGreen()
    • systemBlue

      public static UIColor systemBlue()
    • systemOrange

      public static UIColor systemOrange()
    • systemYellow

      public static UIColor systemYellow()
    • systemPink

      public static UIColor systemPink()
    • systemPurple

      public static UIColor systemPurple()
      Since:
      Available in iOS 9.0 and later.
    • systemTeal

      public static UIColor systemTeal()
    • systemIndigo

      public static UIColor systemIndigo()
      Since:
      Available in iOS 13.0 and later.
    • systemBrown

      public static UIColor systemBrown()
      Since:
      Available in iOS 13.0 and later.
    • systemMint

      public static UIColor systemMint()
      Since:
      Available in iOS 15.0 and later.
    • systemCyan

      public static UIColor systemCyan()
      Since:
      Available in iOS 15.0 and later.
    • systemGray

      public static UIColor systemGray()
    • systemGray2

      public static UIColor systemGray2()
      Since:
      Available in iOS 13.0 and later.
    • systemGray3

      public static UIColor systemGray3()
      Since:
      Available in iOS 13.0 and later.
    • systemGray4

      public static UIColor systemGray4()
      Since:
      Available in iOS 13.0 and later.
    • systemGray5

      public static UIColor systemGray5()
      Since:
      Available in iOS 13.0 and later.
    • systemGray6

      public static UIColor systemGray6()
      Since:
      Available in iOS 13.0 and later.
    • tint

      public static UIColor tint()
      Since:
      Available in iOS 15.0 and later.
    • label

      public static UIColor label()
      Since:
      Available in iOS 13.0 and later.
    • secondaryLabel

      public static UIColor secondaryLabel()
      Since:
      Available in iOS 13.0 and later.
    • tertiaryLabel

      public static UIColor tertiaryLabel()
      Since:
      Available in iOS 13.0 and later.
    • quaternaryLabel

      public static UIColor quaternaryLabel()
      Since:
      Available in iOS 13.0 and later.
    • link

      public static UIColor link()
      Since:
      Available in iOS 13.0 and later.
    • placeholderText

      public static UIColor placeholderText()
      Since:
      Available in iOS 13.0 and later.
    • separator

      public static UIColor separator()
      Since:
      Available in iOS 13.0 and later.
    • opaqueSeparator

      public static UIColor opaqueSeparator()
      Since:
      Available in iOS 13.0 and later.
    • systemBackground

      public static UIColor systemBackground()
      Since:
      Available in iOS 13.0 and later.
    • secondarySystemBackground

      public static UIColor secondarySystemBackground()
      Since:
      Available in iOS 13.0 and later.
    • tertiarySystemBackground

      public static UIColor tertiarySystemBackground()
      Since:
      Available in iOS 13.0 and later.
    • systemGroupedBackground

      public static UIColor systemGroupedBackground()
      Since:
      Available in iOS 13.0 and later.
    • secondarySystemGroupedBackground

      public static UIColor secondarySystemGroupedBackground()
      Since:
      Available in iOS 13.0 and later.
    • tertiarySystemGroupedBackground

      public static UIColor tertiarySystemGroupedBackground()
      Since:
      Available in iOS 13.0 and later.
    • systemFill

      public static UIColor systemFill()
      Since:
      Available in iOS 13.0 and later.
    • secondarySystemFill

      public static UIColor secondarySystemFill()
      Since:
      Available in iOS 13.0 and later.
    • tertiarySystemFill

      public static UIColor tertiarySystemFill()
      Since:
      Available in iOS 13.0 and later.
    • quaternarySystemFill

      public static UIColor quaternarySystemFill()
      Since:
      Available in iOS 13.0 and later.
    • lightText

      public static UIColor lightText()
    • darkText

      public static UIColor darkText()
    • groupTableViewBackground

      @Deprecated public static UIColor groupTableViewBackground()
      Deprecated.
      Deprecated in iOS 13.0. Use systemGroupedBackgroundColor
    • viewFlipsideBackground

      @Deprecated public static UIColor viewFlipsideBackground()
      Deprecated.
      Deprecated in iOS 7.0.
    • scrollViewTexturedBackground

      @Deprecated public static UIColor scrollViewTexturedBackground()
      Deprecated.
      Deprecated in iOS 7.0.
    • underPageBackground

      @Deprecated public static UIColor underPageBackground()
      Deprecated.
      Deprecated in iOS 7.0.
    • getAccessibilityName

      public String getAccessibilityName()
      Since:
      Available in iOS 14.0 and later.
    • supportsSecureCoding

      public static boolean supportsSecureCoding()
    • getReadableTypeIdentifiersForItemProvider

      public static NSArray<NSString> getReadableTypeIdentifiersForItemProvider()
    • getWritableTypeIdentifiersForItemProvider0

      public static NSArray<NSString> getWritableTypeIdentifiersForItemProvider0()
    • getWritableTypeIdentifiersForItemProvider

      public NSArray<NSString> getWritableTypeIdentifiersForItemProvider()
      Specified by:
      getWritableTypeIdentifiersForItemProvider in interface NSItemProviderWriting
    • getWhiteAlpha

      public double[] getWhiteAlpha()
    • getHSBA

      public double[] getHSBA()
    • getRGBA

      public double[] getRGBA()
    • init

      protected long init​(double red, double green, double blue, double alpha)
    • init

      protected long init​(CGColor cgColor)
    • init

      protected long init​(CIColor ciColor)
    • setFillAndStroke

      public void setFillAndStroke()
    • setFill

      public void setFill()
    • setStroke

      public void setStroke()
    • getWhiteAlpha

      protected boolean getWhiteAlpha​(MachineSizedFloatPtr white, MachineSizedFloatPtr alpha)
    • getHSBA

      protected boolean getHSBA​(MachineSizedFloatPtr hue, MachineSizedFloatPtr saturation, MachineSizedFloatPtr brightness, MachineSizedFloatPtr alpha)
    • getRGBA

      protected boolean getRGBA​(MachineSizedFloatPtr red, MachineSizedFloatPtr green, MachineSizedFloatPtr blue, MachineSizedFloatPtr alpha)
    • addAlpha

      public UIColor addAlpha​(double alpha)
    • fromWhiteAlpha

      public static UIColor fromWhiteAlpha​(double white, double alpha)
    • fromHSBA

      public static UIColor fromHSBA​(double hue, double saturation, double brightness, double alpha)
    • fromRGBA

      public static UIColor fromRGBA​(double red, double green, double blue, double alpha)
    • fromDisplayP3

      public static UIColor fromDisplayP3​(double displayP3Red, double green, double blue, double alpha)
      Since:
      Available in iOS 10.0 and later.
    • fromCGColor

      public static UIColor fromCGColor​(CGColor cgColor)
    • fromPatternImage

      public static UIColor fromPatternImage​(UIImage image)
    • fromCIColor

      public static UIColor fromCIColor​(CIColor ciColor)
    • colorNamed

      public static UIColor colorNamed​(String name)
      Since:
      Available in iOS 11.0 and later.
    • fromResourceBundle

      public static UIColor fromResourceBundle​(String name, NSBundle bundle, UITraitCollection traitCollection)
      Since:
      Available in iOS 11.0 and later.
    • init

      protected long init​(Block1<UITraitCollection,​UIColor> dynamicProvider)
      Since:
      Available in iOS 13.0 and later.
    • resolvedColorWithTraitCollection

      public UIColor resolvedColorWithTraitCollection​(UITraitCollection traitCollection)
      Since:
      Available in iOS 13.0 and later.
    • encode

      public void encode​(NSCoder coder)
      Specified by:
      encode in interface NSCoding
    • init

      protected long init​(NSCoder coder)
    • createProviderDataObject

      public static UIColor createProviderDataObject​(NSData data, String typeIdentifier) throws NSErrorException
      Throws:
      NSErrorException
    • getItemProviderVisibility

      public NSItemProviderRepresentationVisibility getItemProviderVisibility​(String typeIdentifier)
      Specified by:
      getItemProviderVisibility in interface NSItemProviderWriting
    • loadData

      public NSProgress loadData​(String typeIdentifier, VoidBlock2<NSData,​NSError> completionHandler)
      Specified by:
      loadData in interface NSItemProviderWriting
    • getItemProviderVisibility0

      public static NSItemProviderRepresentationVisibility getItemProviderVisibility0​(String typeIdentifier)