Opal::UI::Palette
Inherits Opal::UI::Control < Opal::UI::InputHookable < Opal::UI::Element < Opal::UI::Themable < Reference < Object
Interactive Palette UI control supporting Named and Indexed modes,
color reordering via [ and ], min/max constraints, inline renaming,
and seamless embedded ColorPicker integration.
Constructors
indexed(colors : Array(Color), min_colors : Int32 | Nil = nil, max_colors : Int32 | Nil = nil, allow_add : Bool = true, allow_remove : Bool = true, allow_reorder : Bool = true, picker_mode : ColorMode = ColorMode::RGB, picker_layout : ColorPickerLayout = ColorPickerLayout::Sliders, show_picker_alpha : Bool = false, show_picker_harmonies : Bool = true, title : String = "Indexed Palette", width : Int32 | Nil = 54, height : Int32 | Nil = 16) : Palette
Convenience constructor for indexed mode from Array(Color)
named(entries : Hash(String, Color), allow_add : Bool = true, allow_rename : Bool = true, allow_remove : Bool = true, picker_mode : ColorMode = ColorMode::RGB, picker_layout : ColorPickerLayout = ColorPickerLayout::Sliders, show_picker_alpha : Bool = false, show_picker_harmonies : Bool = true, title : String = "Named Palette", width : Int32 | Nil = 54, height : Int32 | Nil = 16) : Palette
Convenience constructor for named mode from Hash(String, Color)
new(model : PaletteModel = PaletteModel.new, picker_mode : ColorMode = ColorMode::RGB, picker_layout : ColorPickerLayout = ColorPickerLayout::Sliders, show_picker_alpha : Bool = false, show_picker_harmonies : Bool = true, title : String = "Color Palette", width : Int32 | Nil = 54, height : Int32 | Nil = 16)
SourceInstance methods
active_border_color
Sourceactive_border_color=(active_border_color : Color)
Sourceborder_color
Sourceborder_color=(border_color : Color)
Sourcecancel_rename
Sourceconfirm_color_edit(color : Color) : Nil
Confirms the edited color from ColorPicker back to the Palette
confirm_rename
Sourceconfirmed?
Sourcecursor
Sourceediting_color?
SourceDefault key event handler. Override in subclasses if not using @default_input_proc.
Default mouse event handler. Override in subclasses if not using @default_input_proc.
height
Sourcelast_h
Sourcelast_w
Sourcelast_x
Sourcelast_y
Sourcemodel
Sourcemodel=(model : PaletteModel)
SourceMoves cursor with bounds checking and triggers selection callback
on_confirm
Sourceon_select
Sourcepicker_layout
Sourcepicker_layout=(picker_layout : ColorPickerLayout)
Sourcepicker_mode
Sourcepicker_mode=(picker_mode : ColorMode)
Sourcerename_buffer
Sourcerender(buffer : Buffer) : Nil
Sourceshow_border?
Sourceshow_picker_alpha?
Sourceshow_picker_harmonies?
Source