ColorPicker#
Download this notebook from GitHub (right-click to download).
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.
Parameters:#
For layout and styling related parameters see the customization user guide.
Core#
value
(color): A hexadecimal RGB color value
Display#
disabled
(boolean): Whether the widget is editablename
(str): The title of the widget
When 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
'#99ef78'
Controls#
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)
Download this notebook from GitHub (right-click to download).