Skip to content

XUIColorSwatch

Inherits DesktopCanvas

Description

A powerful colour swatch control that displays a colour and allows the user to click the control to change the colour. Works in tandem with the XUIColorPicker.

The control's appearance is very customisable through the use of different renderers. Several are provided with XUI that mimic the colour swatch control on macOS, Windows and Linux but you can create your own too.

Properties

Name Type Read-Only
IsActive Boolean
mColorPickerVisible Boolean
mIsActive Boolean
mRenderer XUIColorSwatchRenderer
mValue Color
Renderer XUIColorSwatchRenderer
Value Color

Methods

Name Parameters Returns
Constructor
PickerClosing picker As XUIColorPicker
PickerColorChanged picker As XUIColorPicker, newColor As Color

Events

Name Parameters Returns
ColorChanged newColor As Color

Property Descriptions

IsActive As Boolean

True if the swatch is currently active (i.e. pressed and the color picker is visible). Read only.


mColorPickerVisible As Boolean

True if the color picker is visible.


mIsActive As Boolean

True if the swatch is currently active (i.e. pressed and the color picker is visible).


mRenderer As XUIColorSwatchRenderer

This colour swatch's renderer. Responsible for actualy drawing the control.


mValue As Color

The colour of the swatch.


Renderer As XUIColorSwatchRenderer

This colour swatch's renderer. Responsible for actualy drawing the control.


Value As Color

The colour of the swatch.


Method Descriptions

Constructor()

Default constructor.


PickerClosing(picker As XUIColorPicker)

Delegate called when this swatch's color picker is closing.


PickerColorChanged(picker As XUIColorPicker, newColor As Color)

Delegate that is called when this swatch's color picker's colour is changed.


Event Descriptions

ColorChanged(newColor As Color) The swatch's colour has changed.