Add color picker to docs (#1768)

This commit is contained in:
Freddy Boulton 2022-07-18 04:55:48 -04:00 committed by GitHub
parent dc8dd5e1be
commit 006347459c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -0,0 +1 @@
Pillow

View File

@ -2890,6 +2890,7 @@ class Button(Clickable, IOComponent):
)
@document()
class ColorPicker(Changeable, Submittable, IOComponent):
"""
Creates a color picker for user to select a color as string input.
@ -2912,12 +2913,12 @@ class ColorPicker(Changeable, Submittable, IOComponent):
):
"""
Parameters:
value (str): default text to provide in color picker.
label (Optional[str]): component name in interface.
show_label (bool): if True, will display label.
interactive (Optional[bool]): if True, will be rendered as an editable color picker; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
visible (bool): If False, component will be hidden.
elem_id (Optional[str]): An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
value: default text to provide in color picker.
label: component name in interface.
show_label: if True, will display label.
interactive: if True, will be rendered as an editable color picker; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
visible: If False, component will be hidden.
elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
"""
self.value = self.postprocess(value)
self.cleared_value = "#000000"