color_tools.config
Thread-safe runtime configuration for color processing behavior.
Unlike ColorConstants (which are immutable scientific values), these are user preferences that can be changed and may differ per thread.
- class color_tools.config.ColorConfig[source]
Bases:
_localThread-safe runtime configuration for color processing behavior.
Unlike ColorConstants (which are immutable scientific values), these are user preferences that can be changed and may differ per thread. Uses threading.local() so each thread gets its own independent config.
- color_tools.config.set_dual_color_mode(mode)[source]
Set the global dual-color handling mode for filaments with multiple hex colors.
- Parameters:
mode (
str) – One of “first”, “last”, or “mix” - “first”: Use the first color (default) - “last”: Use the second color - “mix”: Perceptually blend both colors in LAB space- Raises:
ValueError – If mode is not one of the valid options
- Return type:
- color_tools.config.get_dual_color_mode()[source]
Get the current dual-color handling mode.
- Return type:
- color_tools.config.set_gamut_tolerance(tolerance)[source]
Set the tolerance for gamut boundary checking.