Class

DesktopColorPicker

Color Picker

ColorPicker


Description

Displays the operating system's color picker.

Properties

Name

Type

Read-Only

Shared

HasAlpha

Boolean

IsVisible

Boolean

Methods

Name

Parameters

Returns

Shared

Close

Handle

Ptr

Show

initialColor As Color, prompt As String, left As Integer = 0, top As Integer = 0, width As Integer = 230, height As Integer = 415

Events

Name

Parameters

Returns

Closed

ColorSelected

selectedColor As Color

Property descriptions


DesktopColorPicker.HasAlpha

HasAlpha As Boolean

If True, the color selected will be returned with an alpha channel.

The default value is True.


DesktopColorPicker.IsVisible

IsVisible As Boolean

If True, the Color Picker is visible.

The default value is False.

Method descriptions


DesktopColorPicker.Close

Close

Closes the DesktopColorPicker window.


DesktopColorPicker.Handle

Handle As Ptr

Returns a Ptr for use with declares.


DesktopColorPicker.Show

Show(initialColor As Color, prompt As String, left As Integer = 0, top As Integer = 0, width As Integer = 230, height As Integer = 415)

Displays the operating system's color picker using the color, prompt, location and size passed.

On macOS, once your app displays the Color Picker, the OS will continue to show it at that size regardless of what you pass as the width and height.

The Prompt, Left, Top, Width and Height parameters are only supported on macOS.

Event descriptions


DesktopColorPicker.Closed

Closed

The color picker has been closed.


DesktopColorPicker.ColorSelected

ColorSelected(selectedColor As Color)

The user selected the color passed.

Notes

On Windows and Linux, the operating system's color picker window is modal. On macOS, the color picker is not modal. This means that on macOS, the ColorSelected event will fire every time the user clicks on a color.

On macOS, if the Color Picker was left open when the user quit your app, it will be automatically closed upon relaunch.

Compatibility

Desktop projects on all supported operating systems.

See also

Object parent class; Color class.