ColorPicker
A Fluent color picker: a color spectrum with sliders and text fields to pick a color.
Example:
fluent.ColorPicker(value="#0078d4", show_more_button=False)

Inherits: LayoutControl
Properties
alpha_enabled- Whether the color can be partly transparent.horizontal- Whether the inputs are shown next to the spectrum, instead of below it.max_brightness- The largest brightness offered, from0to100.max_hue- The largest hue offered, from0to359.max_saturation- The largest saturation offered, from0to100.min_brightness- The smallest brightness offered, from0to100.min_hue- The smallest hue offered, from0to359.min_saturation- The smallest saturation offered, from0to100.show_alpha_input- Whether an opacity field is shown, whenalpha_enabled.show_alpha_slider- Whether an opacity slider is shown, whenalpha_enabled.show_channel_inputs- Whether fields for the red, green and blue (or hue, saturation and value) channels are shown.show_color_slider- Whether a brightness slider is shown below the spectrum.show_hex_input- Whether a field for the hexadecimal color code is shown.show_more_button- Whether the color channel inputs are hidden behind a "More" button.show_preview- Whether a swatch of the selected color is shown next to the spectrum.spectrum_shape- The shape of the color spectrum.value- The selected color.
Events
on_change- Called when the user changes the color.
Example
Fluent ColorPicker
import flet_fluent_ui as fluent
import flet as ft
def main(page: ft.Page):
page.title = "Fluent ColorPicker"
def handle_change(e: ft.Event[fluent.ColorPicker]):
swatch.bgcolor = e.control.value
label.value = e.control.value
swatch = ft.Container(width=80, height=80, border_radius=8, bgcolor="#ff0078d4")
label = ft.Text("#ff0078d4")
page.add(
ft.SafeArea(
content=ft.Row(
vertical_alignment=ft.CrossAxisAlignment.START,
controls=[
fluent.ColorPicker(
key="picker",
value="#ff0078d4",
show_more_button=False,
on_change=handle_change,
),
ft.Column(controls=[swatch, label]),
],
)
)
)
if __name__ == "__main__":
ft.run(main)

Properties
alpha_enabledclass-attributeinstance-attribute
alpha_enabled: bool = TrueWhether the color can be partly transparent.
horizontalclass-attributeinstance-attribute
horizontal: bool = FalseWhether the inputs are shown next to the spectrum, instead of below it.
max_brightnessclass-attributeinstance-attribute
max_brightness: int = 100The largest brightness offered, from 0 to 100.
max_saturationclass-attributeinstance-attribute
max_saturation: int = 100The largest saturation offered, from 0 to 100.
min_brightnessclass-attributeinstance-attribute
min_brightness: int = 0The smallest brightness offered, from 0 to 100.
min_saturationclass-attributeinstance-attribute
min_saturation: int = 0The smallest saturation offered, from 0 to 100.
show_alpha_inputclass-attributeinstance-attribute
show_alpha_input: bool = TrueWhether an opacity field is shown, when alpha_enabled.
show_alpha_sliderclass-attributeinstance-attribute
show_alpha_slider: bool = TrueWhether an opacity slider is shown, when alpha_enabled.
show_channel_inputsclass-attributeinstance-attribute
show_channel_inputs: bool = TrueWhether fields for the red, green and blue (or hue, saturation and value) channels are shown.
show_color_sliderclass-attributeinstance-attribute
show_color_slider: bool = TrueWhether a brightness slider is shown below the spectrum.
show_hex_inputclass-attributeinstance-attribute
show_hex_input: bool = TrueWhether a field for the hexadecimal color code is shown.
show_more_buttonclass-attributeinstance-attribute
show_more_button: bool = TrueWhether the color channel inputs are hidden behind a "More" button.
If False, the inputs are always shown (if enabled by
show_channel_inputs and show_hex_input).
show_previewclass-attributeinstance-attribute
show_preview: bool = TrueWhether a swatch of the selected color is shown next to the spectrum.
spectrum_shapeclass-attributeinstance-attribute
spectrum_shape: ColorSpectrumShape = ColorSpectrumShape.RINGThe shape of the color spectrum.
valueclass-attributeinstance-attribute
value: ColorValue | None = NoneThe selected color.
If None, the picker starts at Fluent blue (#0078D4). After the user
picks a color, it holds a #aarrggbb string.
Events
on_changeclass-attributeinstance-attribute
on_change: ControlEventHandler[ColorPicker] | None = NoneCalled when the user changes the color.
value holds the new color.