import panel as pn
pn.extension()
The ColorPicker
widget allows selecting a color using the browser's color-picking widget support.
For more information about listening to widget events and laying out widgets refer to the widgets user guide. Alternatively you can learn how to build GUIs by declaring parameters independently of any specific widgets in the param user guide. To express interactivity entirely using Javascript without the need for a Python server take a look at the links user guide.
For layout and styling related parameters see the customization user guide.
value
(color): A hexadecimal RGB color valuedisabled
(boolean): Whether the widget is editablename
(str): The title of the widgetWhen clicked the ColorPicker
opens a browser-dependent color-picking widget:
colorpicker = pn.widgets.ColorPicker(name='Color Picker', value='#99ef78')
colorpicker
ColorPicker.value
returns a hexadecimal RGB value:
colorpicker.value
The ColorPicker
widget exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively:
pn.Row(colorpicker.controls(jslink=True), colorpicker)