color_tools.cli_commands.utils
Utility functions for CLI argument parsing and validation.
Helper functions used across CLI command handlers to reduce duplication.
- color_tools.cli_commands.utils.validate_color_input_exclusivity(args)[source]
Validate that –value and –hex are mutually exclusive.
- Parameters:
args (
Namespace) – Parsed command-line arguments- Raises:
SystemExit – If both –value and –hex are specified
- Return type:
- color_tools.cli_commands.utils.get_rgb_from_args(args)[source]
Extract RGB tuple from either –value or –hex arguments.
- color_tools.cli_commands.utils.parse_hex_or_exit(hex_string)[source]
Parse a hex color string into RGB values, exiting on error.
- color_tools.cli_commands.utils.is_valid_lab(lab_tuple)[source]
Validate if a Lab tuple is within the standard 8-bit Lab range. Lab tuple format: (L*, a*, b*)
- Parameters:
lab_tuple – Tuple or list of 3 numeric values
- Return type:
- Returns:
True if valid Lab values, False otherwise