bec_widgets.utils.palette_viewer ================================ .. py:module:: bec_widgets.utils.palette_viewer Classes ------- .. autoapisummary:: bec_widgets.utils.palette_viewer.PaletteViewer Module Contents --------------- .. py:class:: PaletteViewer(*args, parent=None, **kwargs) Bases: :py:obj:`bec_widgets.utils.bec_widget.BECWidget`, :py:obj:`qtpy.QtWidgets.QWidget` This class is a widget that displays current palette colors. Base class for all BEC widgets. This class should be used as a mixin class for all BEC widgets, e.g.: >>> class MyWidget(BECWidget, QWidget): >>> def __init__(self, parent=None, client=None, config=None, gui_id=None): >>> super().__init__(parent=parent, client=client, config=config, gui_id=gui_id) :param client: The BEC client. :type client: BECClient, optional :param config: The connection configuration. :type config: ConnectionConfig, optional :param gui_id: The GUI ID. :type gui_id: str, optional :param theme_update: Whether to subscribe to theme updates. Defaults to False. When set to True, the widget's apply_theme method will be called when the theme changes. :type theme_update: bool, optional .. py:method:: apply_theme(theme) -> None Apply the theme to the widget. :param theme: The theme to apply. :type theme: str .. py:method:: background_label_with_clipboard(color) -> qtpy.QtWidgets.QLabel Create a label with a background color that copies the color to the clipboard when clicked. :param color: The color to display in the background. :type color: QColor :returns: The label with the background color. :rtype: QLabel .. py:method:: clear_palette() -> None Clear the palette colors from the frame. Recursively removes all widgets and layouts in the frame layout. .. py:method:: update_palette() -> None Update the palette colors in the frame. .. py:attribute:: ICON_NAME :value: 'palette' .. py:attribute:: RPC :value: False .. py:attribute:: frame .. py:attribute:: frame_layout