Class: DFCUI::ColorPicker
Overview
ColorPicker 为 DFC 统一的颜色选择器
颜色值的格式为:16 进制,6 个字符,html 颜色格式。例:ffffff, ffcc00
Instance Method Summary # collapse
-
#close ⇒ Nil
关闭颜色选择器.
-
#dialog ⇒ UI::WebDialog, Nil
返回颜色选择器的 UI::WebDialog 对象.
-
#event {|color_picker, event, value| ... } ⇒ Nil
颜色选择器的事件处理.
-
#initialize(hex_color = nil) ⇒ ColorPicker
constructor
初始化.
-
#show(x = nil, y = nil) ⇒ Nil
常规显示颜色选择器.
-
#show_modal(x = nil, y = nil) ⇒ Nil
模态显示颜色选择器,窗口关闭前无法执行其他操作.
Constructor Details
↑ #initialize(hex_color = nil) ⇒ ColorPicker
初始化
Instance Method Details
↑ #close ⇒ Nil
关闭颜色选择器
↑ #dialog ⇒ UI::WebDialog, Nil
返回颜色选择器的 UI::WebDialog 对象
↑ #event {|color_picker, event, value| ... } ⇒ Nil
颜色选择器的事件处理
一共有以下 4 个事件,事件参数类型为 Symbol
:confirm -> 确定按钮
:change -> 用户切换颜色
:cancel -> 取消按钮
:close -> 窗口关闭事件
↑ #show(x = nil, y = nil) ⇒ Nil
常规显示颜色选择器
↑ #show_modal(x = nil, y = nil) ⇒ Nil
模态显示颜色选择器,窗口关闭前无法执行其他操作