ColorPicker
Last updated
Last updated
ColorPicker
is a color selector supporting multiple color formats.
Determine whether to display the alpha slider.
type: bool
default value: False
Determine color format(hsl, hsv, hex, rgb).
type: Literal["hex", "hsl", "hsv", "rgb"]
default value: hex
Make widget compact.
type: bool
default value: False
ID of the widget.
type: str
default value: None
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/input/007_color_picker/src/main.py
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare a layout for app using Card
widget with the content
parameter.
Create an app object with layout parameter.
Parameters | Type | Description |
---|---|---|
Attributes and Methods | Description |
---|---|
show_alpha
bool
Whether to display the alpha slider
color_format
Literal["hex", "hsl", "hsv", "rgb"]
Color format
compact
bool
Make widget compact
widget_id
str
ID of the widget
get_value()
Return ColorPicker
current color
set_value()
Set ColorPicker
color
is_show_alpha_enabled()
Check if show_alpha
is True
or False
enable_show_alpha()
Enable show_alpha
disable_show_alpha()
Disable show_alpha
get_color_format()
Return ColorPicker
color format
set_color_format()
Set ColorPicker
color format
value_changed()
Handle color change event