Skip to content

XUIColorPicker

Description

A beautiful colour picker tool.

Properties

Name Type Read-Only
CurrentColor Color
mCurrentColor Color
mStartingColor Color

Methods

Name Parameters Returns
AppearanceChanged
ColorComponentSliderPressed slider As XUIColorComponentSlider, newColor As Color
Constructor startingColor As Color
ConstructPalettes
DraggingColorComponentSliderScrubber slider As XUIColorComponentSlider
NotificationReceived n As XUINotification
RefreshCMYSlidersPanel
RefreshHSVSlidersPanel
RefreshRGBASlidersPanel
RegisterForNotifications
SwitchMainPanel panelIndex As Integer
Update

Events

Name Parameters Returns
ColorChanged newColor As Color

Constants

Name Type
HEIGHT_SLIDERS Double
HEIGHT_SWATCHES Double
PANEL_MAIN_SLIDERS Double
PANEL_MAIN_SWATCHES Double
PANEL_SLIDERS_CMY Double
PANEL_SLIDERS_HSV Double
PANEL_SLIDERS_RGB Double

HEIGHT_SLIDERS As Double The height the picker window should be when displaying the sliders panel.


HEIGHT_SWATCHES As Double The height the picker window should be when displaying the swatches panel.


PANEL_MAIN_SLIDERS As Double Index of the panel containing the sliders.


PANEL_MAIN_SWATCHES As Double Index of the panel containing the main swatches.


PANEL_SLIDERS_CMY As Double Index of the panel containing the RGB sliders.


PANEL_SLIDERS_HSV As Double Index of the panel containing the RGB sliders.


PANEL_SLIDERS_RGB As Double Index of the panel containing the RGB sliders.


Property Descriptions

CurrentColor As Color

The currently selected colour.


mCurrentColor As Color

The currently selected colour.


mStartingColor As Color

The starting color when the picker first opens.


Method Descriptions

AppearanceChanged()

Handles an OS appearance change (e.g. light to dark mode switch).


ColorComponentSliderPressed(slider As XUIColorComponentSlider, newColor As Color)

Delegate for handling the pressing of a colour component slider.


Constructor(startingColor As Color)

Default constructor. Takes a Color.


ConstructPalettes() Adds the colour dots and their palettes.


DraggingColorComponentSliderScrubber(slider As XUIColorComponentSlider)

Delegate for handling the dragging of a colour component slider scrubber.


NotificationReceived(n As XUINotification)

A notification has been received from the Notification Center.

Part of the XUINotificationListener interface.


RefreshCMYSlidersPanel()

Refreshes all the controls on the CMY sliders panel to reflect mCurrentColor.


RefreshHSVSlidersPanel()

Refreshes all the controls on the HSV sliders panel to reflect mCurrentColor.


RefreshRGBASlidersPanel()

Refreshes all the controls on the RGBA sliders panel to reflect mCurrentColor.


RegisterForNotifications()

Registers the color picker for desired notifications.


SwitchMainPanel(panelIndex As Integer)

Switches to the specified main panel.


Update()

Updates all controls to match the current colour.


Event Descriptions

ColorChanged(newColor As Color) The selected colour in the picker has changed.