Color scheme
The color scheme controls the colours used for nodes, edges and sockets.
nodeeditor.node_colors_config ¶
A module for centralized color configuration for the Node Editor.
This module provides a single point to manage and update all colors used in: - Edge graphics (default, selected, hovered, dragging) - Socket graphics (background colors per type, highlighting, outlines)
BaseColors ¶
Base class for color configurations _Parameters: - _default: Default color - _selected: Selected color - _hovered: Hovered color - _dragging: Dragging color
EdgeColors ¶
Bases: BaseColors
Configuration for Edge colors
set_all ¶
Set all edge colors at once
:param default: Default edge color :param selected: Selected edge color :param hovered: Hovered edge color :param dragging: Dragging edge color
SocketColors ¶
Bases: BaseColors
Configuration for Socket colors
get_type_color ¶
Get color for a specific socket type
:param socket_type: Socket type index :return: QColor for the socket type
set_type_color ¶
Set color for a specific socket type
:param socket_type: Socket type index :param color: Color to set
set_type_colors ¶
Set all socket type colors at once
:param colors: List of colors
get_all_type_colors ¶
Get all socket type colors
:return: List of QColor objects
set_all ¶
Set all socket colors at once
:param outline: Socket outline color :param highlight: Socket highlight color :param type_colors: List of socket type colors
NodesColors ¶
Bases: BaseColors
Configuration for Node colors
This class reuses the EdgeColors structure to define colors for nodes.
NodeEditorColorScheme ¶
Global color scheme configuration for Node Editor
This class provides a centralized way to manage and update all colors used in the node editor, including edge colors and socket colors.
Example: >>> scheme = NodeEditorColorScheme() >>> scheme.edges.default = "#FF0000" # Red edges >>> scheme.sockets.highlight = "#00FF00" # Green highlights
get_instance
classmethod
¶
Get the singleton instance of the color scheme
:return: NodeEditorColorScheme instance
to_dict ¶
Export current color scheme to dictionary
:return: Dictionary representation of the color scheme
from_dict ¶
Import color scheme from dictionary
:param config: Dictionary with color configuration
get_color_scheme ¶
Get the global color scheme instance
:return: NodeEditorColorScheme instance