Color Picker#
- squap.add_color_picker(
- name,
- init_value=(255, 255, 255),
- var_name=None,
- print_value=False,
- row=None,
Adds a
color pickerto the main input widget, or to allinput tablesif there are more.- Parameters:
name (str) – The name in front of the color picker.
init_value (ColorType) – The initial value of the color picker.
var_name (str, optional) – The name of the created variable. If
var_nameis not provided, the variable will be namedname.print_value (bool) – Whether to print the value of the color picker when it changes. Defaults to
False.row (int, optional) – Row to which the color picker is added. Defaults to first empty row.
- Returns:
The created
color_picker widget(s).- Return type:
ColorPicker or list of ColorPicker
- class squap.widgets.InputTable.ColorPicker#
- ColorPicker.bind(func)#
Bind function
functo this box, meaning that when the value of the box is changed, the function is called.- Parameters:
func (callable) – function to bind to this box.
- ColorPicker.unbind(func)#
Unbind function. Is used internally when removing a box.
- Parameters:
func (callable) – function to unbind from this box.
- ColorPicker.set_value(value)#
Set the value of the box and var.var_name to
value. Note that for a slider, the new slider position will be the closest possible position tovalue, and the new value of var.var_name will be the value corresponding to the new slider position.
- ColorPicker.value()#
Return the current value of var.var_name
- ColorPicker.change_params(**kwargs)#
Changes the parameters of the color_picker. Only keyword arguments are accepted, and takes all arguments that
squap.add_color_picker()accepts, exceptinit_valueandrow.
- ColorPicker.print_val()#
Print the current value of the box. Used for the
print_valuekeyword argument.
- ColorPicker.remove()#
Remove this box.