SlidePicker
A slider-based color picker that exposes RGB/HSV/HSL channels with optional labels and indicators.

Inherits: LayoutControl
Properties
color- The currently selected color.color_model- The color model used by the sliders.display_thumb_color- Whether to display the thumb color in sliders.enable_alpha- Whether to enable alpha (opacity) slider.indicator_alignment_begin- Alignment for the indicator split begin.indicator_alignment_end- Alignment for the indicator split end.indicator_border_radius- Border radius for the indicator.indicator_size- Size of the indicator.label_text_style- Text style for labels.label_types- Color label types to display.show_indicator- Whether to show the color indicator.show_label- Whether to show labels.show_params- Whether to show parameter values.show_slider_text- Whether to show slider text.slider_size- Size of the sliders.slider_text_style- Text style for slider text.
Events
on_color_change- Called when the picker color is changed.
Example
import flet as ft
from flet_color_pickers import ColorModel, SlidePicker
def main(page: ft.Page):
page.title = "SlidePicker"
page.padding = 20
def on_color_change(e: ft.ControlEvent):
print(f"color: {e.data}")
picker = SlidePicker(
color="#0000ff",
color_model=ColorModel.RGB,
indicator_border_radius=ft.BorderRadius.all(5),
on_color_change=on_color_change,
)
page.add(ft.SafeArea(content=picker))
if __name__ == "__main__":
ft.run(main)
Properties
color_modelclass-attributeinstance-attribute
color_model: ColorModel | None = NoneThe color model used by the sliders.
display_thumb_colorclass-attributeinstance-attribute
display_thumb_color: bool = TrueWhether to display the thumb color in sliders.
enable_alphaclass-attributeinstance-attribute
enable_alpha: bool = TrueWhether to enable alpha (opacity) slider.
indicator_alignment_beginclass-attributeinstance-attribute
indicator_alignment_begin: Alignment | None = NoneAlignment for the indicator split begin.
indicator_alignment_endclass-attributeinstance-attribute
indicator_alignment_end: Alignment | None = NoneAlignment for the indicator split end.
indicator_border_radiusclass-attributeinstance-attribute
indicator_border_radius: BorderRadiusValue | None = NoneBorder radius for the indicator.
indicator_sizeclass-attributeinstance-attribute
indicator_size: Size | None = NoneSize of the indicator.
label_text_styleclass-attributeinstance-attribute
label_text_style: TextStyle | None = NoneText style for labels.
label_typesclass-attributeinstance-attribute
label_types: list[ColorLabelType] | None = NoneColor label types to display.
show_indicatorclass-attributeinstance-attribute
show_indicator: bool = TrueWhether to show the color indicator.
show_paramsclass-attributeinstance-attribute
show_params: bool = TrueWhether to show parameter values.
show_slider_textclass-attributeinstance-attribute
show_slider_text: bool = TrueWhether to show slider text.
Events
on_color_changeclass-attributeinstance-attribute
on_color_change: (
ControlEventHandler[SlidePicker] | None
) = NoneCalled when the picker color is changed.
The data property of the event handler argument contains
the color value as a hex string.