ColorPickerConfiguration
@objc(HBColorPickerConfiguration)
open class ColorPickerConfiguration : NSObject
ColorPickerConfiguration is used to configure an instance of ColorPickerViewController
.
-
Initialise a configuration object with the required color property configured.
Declaration
Swift
@objc public init(color: UIColor)
-
The initial color to use when launching the color picker. Required. If you don’t have a value set yet, provide a sensible default.
Declaration
Swift
@objc open var color: UIColor
-
Whether to allow the user to set an alpha transparency value on the color. This controls the visibility of an Alpha slider on the Sliders tab. When set to
false
, alpha values provided via thecolor
property, or by the user when entering a hexadecimal value on the Sliders tab, will be discarded.Declaration
Swift
@objc open var supportsAlpha: Bool
-
The title to display at the top of the popup. If set to
nil
, no title will be displayed. The default isnil
.Declaration
Swift
@objc open var title: String?
-
The initial tab to select when the color picker is presented. The default is
ColorPickerTab.swatch
.This value must be found in
visibleTabs
.See
visibleTabs
Declaration
Swift
@objc open var initialTab: ColorPickerTab
-
The tabs the user can select and switch between at the top of the window, if tabs are enabled by
showTabs
.See
initialTab
Declaration
Swift
@nonobjc open var visibleTabs: [ColorPickerTab]
-
Maps
visibleTabs
to Objective-C due to Swift limitations. This is an implementation detail. Ignore this and usevisibleTabs
per usual.Declaration
Swift
@objc(visibleTabs) open var _visibleTabsObjC: [ColorPickerTab.RawValue] { get set }
-
Whether to display the tab selection at the top of the popup. The default is
true
. When set tofalse
, the user will only be able to access the tab specified in initialTab.Declaration
Swift
@objc open var showTabs: Bool
-
When the Smart Invert accessibility feature is enabled, Alderis instructs the system to not invert most of its user interface. This ensures the user can make a more accurate color selection. If this behavior is not desired, you can disable it here.
Declaration
Swift
@objc open var overrideSmartInvert: Bool
-
Whether the user can end a drag interaction by dropping on the color picker window, allowing them to drag a color from a supporting app. The default is
true
.Declaration
Swift
@objc open var isDropInteractionEnabled: Bool