@_with_element
def beta_color_picker(self, element, label, value=None, key=None):
    "Display a color picker widget.\n\n        Note: This is a beta feature. See\n        https://docs.streamlit.io/en/latest/pre_release_features.html for more\n        information.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this input is for.\n        value : str or None\n            The hex value of this widget when it first renders. If None,\n            defaults to black.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        str\n            The selected color as a hex string.\n\n        Example\n        -------\n        >>> color = st.beta_color_picker('Pick A Color', '#00f900')\n        >>> st.write('The current color is', color)\n\n        "
    if (value is None):
        value = '#000000'
    if (not isinstance(value, str)):
        raise StreamlitAPIException(("\n                Color Picker Value has invalid type: %s. Expects a hex string\n                like '#00FFAA' or '#000'.\n                " % type(value).__name__))
    match = re.match('^#(?:[0-9a-fA-F]{3}){1,2}$', value)
    if (not match):
        raise StreamlitAPIException(("\n                '%s' is not a valid hex code for colors. Valid ones are like\n                '#00FFAA' or '#000'.\n                " % value))
    element.color_picker.label = label
    element.color_picker.default = str(value)
    ui_value = _get_widget_ui_value('color_picker', element, user_key=key)
    current_value = (ui_value if (ui_value is not None) else value)
    return str(current_value)
Display a color picker widget.

Note: This is a beta feature. See
https://docs.streamlit.io/en/latest/pre_release_features.html for more
information.

Parameters
----------
label : str
    A short label explaining to the user what this input is for.
value : str or None
    The hex value of this widget when it first renders. If None,
    defaults to black.
key : str
    An optional string to use as the unique key for the widget.
    If this is omitted, a key will be generated for the widget
    based on its content. Multiple widgets of the same type may
    not share the same key.

Returns
-------
str
    The selected color as a hex string.

Example
-------
>>> color = st.beta_color_picker('Pick A Color', '#00f900')
>>> st.write('The current color is', color)
@_with_element
def beta_color_picker(self, element, label, value=None, key=None):
    "Display a color picker widget.\n\n        Note: This is a beta feature. See\n        https://docs.streamlit.io/en/latest/pre_release_features.html for more\n        information.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this input is for.\n        value : str or None\n            The hex value of this widget when it first renders. If None,\n            defaults to black.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        str\n            The selected color as a hex string.\n\n        Example\n        -------\n        >>> color = st.beta_color_picker('Pick A Color', '#00f900')\n        >>> st.write('The current color is', color)\n\n        "
    if (value is None):
        value = '#000000'
    if (not isinstance(value, str)):
        raise StreamlitAPIException(("\n                Color Picker Value has invalid type: %s. Expects a hex string\n                like '#00FFAA' or '#000'.\n                " % type(value).__name__))
    match = re.match('^#(?:[0-9a-fA-F]{3}){1,2}$', value)
    if (not match):
        raise StreamlitAPIException(("\n                '%s' is not a valid hex code for colors. Valid ones are like\n                '#00FFAA' or '#000'.\n                " % value))
    element.color_picker.label = label
    element.color_picker.default = str(value)
    ui_value = _get_widget_ui_value('color_picker', element, user_key=key)
    current_value = (ui_value if (ui_value is not None) else value)
    return str(current_value)