Skip to main content

SlidePicker

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

SlidePicker
Basic SlidePicker

Inherits: LayoutControl

Properties

Events

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

colorclass-attributeinstance-attribute

color: Optional[ColorValue] = None

The currently selected color.

color_modelclass-attributeinstance-attribute

color_model: Optional[ColorModel] = None

The color model used by the sliders.

display_thumb_colorclass-attributeinstance-attribute

display_thumb_color: bool = True

Whether to display the thumb color in sliders.

enable_alphaclass-attributeinstance-attribute

enable_alpha: bool = True

Whether to enable alpha (opacity) slider.

indicator_alignment_beginclass-attributeinstance-attribute

indicator_alignment_begin: Optional[Alignment] = None

Alignment for the indicator split begin.

indicator_alignment_endclass-attributeinstance-attribute

indicator_alignment_end: Optional[Alignment] = None

Alignment for the indicator split end.

indicator_border_radiusclass-attributeinstance-attribute

indicator_border_radius: Optional[BorderRadiusValue] = None

Border radius for the indicator.

indicator_sizeclass-attributeinstance-attribute

indicator_size: Optional[Size] = None

Size of the indicator.

label_text_styleclass-attributeinstance-attribute

label_text_style: Optional[TextStyle] = None

Text style for labels.

label_typesclass-attributeinstance-attribute

label_types: Optional[list[ColorLabelType]] = None

Color label types to display.

show_indicatorclass-attributeinstance-attribute

show_indicator: bool = True

Whether to show the color indicator.

show_labelclass-attributeinstance-attribute

show_label: bool = True

Whether to show labels.

show_paramsclass-attributeinstance-attribute

show_params: bool = True

Whether to show parameter values.

show_slider_textclass-attributeinstance-attribute

show_slider_text: bool = True

Whether to show slider text.

slider_sizeclass-attributeinstance-attribute

slider_size: Optional[Size] = None

Size of the sliders.

slider_text_styleclass-attributeinstance-attribute

slider_text_style: Optional[TextStyle] = None

Text style for slider text.

Events

on_color_changeclass-attributeinstance-attribute

on_color_change: Optional[ControlEventHandler[SlidePicker]] = None

Called when the picker color is changed.

The data property of the event handler argument contains the color value as a hex string.