ColorPanel

Overview

Creates a new color panel that allows the user to select a color. This opens the native OS window that handles color selection.

Ancestors

  1. None
 

Descendants

  1. None
 

See Also

  1. None

Constructors

new ColorPanel
Description

Creates a new ColorPanel window that's hidden by default.

Definition

new ColorPanel()

Members

allowAlpha
Description

Gets or sets whether the user may select a color with an alpha component in it (e.g., a semi-translucent color).

Definition

boolean colorpanel.allowAlpha (default true)
selected
Description

Gets or sets the selected color in the color panel.

Definition

Color colorpanel.selected
visible
Description

Gets or sets whether the color panel is visible or hidden.

Definition

boolean colorpanel.visible

Methods

addEventListener(eventName, callback)
Description

Adds an event listener for various control level events. The first parameter is the name of the event, the second parameter is the function to call when the event happens (e.g., a callback).

Definition

colorpanel.addEventListener(eventName, callback)
Parameters
NameTypeDescription
eventName string The name of the event to start listening to.
callback function The function that will be called when it occurs.
removeEventListener(eventName, callback)
Description

Removes an event listener for various application level events. The first parameter is the name of the event, the second parameter is the function that was originally given as the callback for addEventListener.

Definition

colorpanel.removeEventListener(eventName, callback)
Parameters
NameTypeDescription
eventName string The name of the event to stop listening to.
callback function The function that would have been called.

Events

colorchange
Description

Fires when the user selects a new color in the panel.

Definition

colorpanel.addEventListener('colorchange', function() { ... });