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