enaml.widgets.color_dialog

Classes

ColorDialog

A toolkit dialog that allows the user to select a color.

class enaml.widgets.color_dialog.ColorDialog(parent=None, **kwargs)[source]

Bases: ToolkitDialog

A toolkit dialog that allows the user to select a color.

current_color

The currently selected color of the dialog.

show_alpha

Whether or not to show the alpha value control.

show_buttons

Whether or not to show the dialog ok/cancel buttons.

selected_color

The color selected when the user clicks accepts the dialog. This value is output only.

proxy

A reference to the ProxyColorDialog object.

static get_color(parent=None, **kwargs)[source]

A static method which launches a color dialog.

Parameters:
  • parent (ToolkitObject or None) – The parent toolkit object for this dialog.

  • **kwargs – Additional data to pass to the dialog constructor.

Returns:

result – The selected color or None if no color was selected.

Return type:

Color or None

static custom_count()[source]

Get the number of available custom colors.

The custom colors are shared among all color dialogs.

Returns:

result – The number of available custom colors.

Return type:

int

Notes

The Application object must exist before calling this method.

static custom_color(index)[source]

Get the custom color for the given index.

The custom colors are shared among all color dialogs.

Parameters:

index (int) – The integer index of the custom color.

Returns:

result – The custom color for the index.

Return type:

Color

Notes

The Application object must exist before calling this method.

static set_custom_color(index, color)[source]

Set the custom color for the given index.

The custom colors are shared among all color dialogs.

Parameters:
  • index (int) – The integer index of the custom color.

  • color (Color) – The custom color to set for the index

Notes

The Application object must exist before calling this method.