bec_widgets.utils.palette_viewer#

Classes#

PaletteViewer

This class is a widget that displays current palette colors.

Module Contents#

class PaletteViewer(*args, parent=None, **kwargs)#

Bases: bec_widgets.utils.bec_widget.BECWidget, 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)
Parameters:
  • client (BECClient, optional) – The BEC client.

  • config (ConnectionConfig, optional) – The connection configuration.

  • gui_id (str, optional) – The GUI ID.

  • theme_update (bool, optional) – 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.

apply_theme(theme) None#

Apply the theme to the widget.

Parameters:

theme (str) – The theme to apply.

background_label_with_clipboard(color) qtpy.QtWidgets.QLabel#

Create a label with a background color that copies the color to the clipboard when clicked.

Parameters:

color (QColor) – The color to display in the background.

Returns:

The label with the background color.

Return type:

QLabel

clear_palette() None#

Clear the palette colors from the frame. Recursively removes all widgets and layouts in the frame layout.

update_palette() None#

Update the palette colors in the frame.

ICON_NAME = 'palette'#
RPC = False#
frame#
frame_layout#