Class ColorButton
Defined in: ColorButton.js.
Constructor Attributes | Constructor Name and Description |
---|---|
ColorButton(preferences, observer)
A component to select a color through a dialog, after clicking a button.
|
Method Attributes | Method Name and Description |
---|---|
getColor()
Returns the color displayed by this button.
|
|
Returns the title of color dialog displayed when this button is pressed.
|
|
setColor(color)
Sets the color displayed by this button.
|
|
setColorDialogTitle(colorDialogTitle)
Sets the title of color dialog displayed when this button is pressed.
|
|
setEnabled(enabled)
Enables or disables this component.
|
Class Detail
ColorButton(preferences, observer)
A component to select a color through a dialog, after clicking a button.
Author: Louis Grignon, Emmanuel Puybaret.
Author: Louis Grignon, Emmanuel Puybaret.
- Parameters:
- {UserPreferences} preferences
- {{ colorChanged: function(number) }} observer Optional
- the observer that will be notified when the color of the button changed.
It may define
colorChanged
called with selected color, as ARGB int, when a color is selected
Method Detail
{number}
getColor()
Returns the color displayed by this button.
- Returns:
- {number} the RGB code of the color of this button or
null
.
getColorDialogTitle()
Returns the title of color dialog displayed when this button is pressed.
setColor(color)
Sets the color displayed by this button.
- Parameters:
- {number} color
- RGB code of the color or
null
.
setColorDialogTitle(colorDialogTitle)
Sets the title of color dialog displayed when this button is pressed.
- Parameters:
- {string} colorDialogTitle
setEnabled(enabled)
Enables or disables this component.
- Parameters:
- {boolean} enabled