Class: Nuklear::UI::ColorPicker
- Defined in:
- lib/nuklear/ui/color_picker.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(color, type: :rgba, **options) ⇒ ColorPicker
constructor
A new instance of ColorPicker.
- #result(color, context) ⇒ Object
- #to_command ⇒ Object
Methods inherited from Base
Methods included from Enableable
#disable, #disabled=, #disabled?, #enable, #enabled=, #enabled?
Methods included from Events
#event_listeners_for, #on, #trigger
Constructor Details
#initialize(color, type: :rgba, **options) ⇒ ColorPicker
Returns a new instance of ColorPicker.
7 8 9 10 11 |
# File 'lib/nuklear/ui/color_picker.rb', line 7 def initialize(color, type: :rgba, **) super(**) self.color = color self.type = type end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
4 5 6 |
# File 'lib/nuklear/ui/color_picker.rb', line 4 def color @color end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/nuklear/ui/color_picker.rb', line 5 def type @type end |
Instance Method Details
#result(color, context) ⇒ Object
24 25 26 27 28 |
# File 'lib/nuklear/ui/color_picker.rb', line 24 def result(color, context) @color = color trigger :color_changed @last_event = nil end |
#to_command ⇒ Object
20 21 22 |
# File 'lib/nuklear/ui/color_picker.rb', line 20 def to_command [:ui_color_picker, color, type] end |