color_tools.cli_commands
CLI package for color_tools.
- color_tools.cli_commands.handle_name_command(args)[source]
Handle the ‘name’ command - generate descriptive color names.
- Exits:
0: Success 2: Invalid input
- color_tools.cli_commands.handle_validate_command(args)[source]
Handle the ‘validate’ command - verify color name matches hex code.
- Exits:
0: Color is a match 1: Color is not a match
- color_tools.cli_commands.handle_cvd_command(args)[source]
Handle the ‘cvd’ command - simulate or correct color vision deficiency.
- Exits:
0: Success 2: Invalid input
- color_tools.cli_commands.handle_color_command(args, json_path=None)[source]
Handle the ‘color’ command - search and query CSS colors.
- Parameters:
- Return type:
- Exits:
0: Success 1: Color not found or error 2: Invalid input
- color_tools.cli_commands.handle_filament_command(args, json_path=None)[source]
Handle the ‘filament’ command - search and query 3D printing filaments.
- Parameters:
- Return type:
- Exits:
0: Success 1: Filament not found or error 2: Invalid input
- color_tools.cli_commands.handle_convert_command(args)[source]
Handle the ‘convert’ command - convert between color spaces and check gamut.
- Exits:
0: Success 2: Invalid input
- color_tools.cli_commands.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.get_rgb_from_args(args)[source]
Extract RGB tuple from either –value or –hex arguments.
- color_tools.cli_commands.parse_hex_or_exit(hex_string)[source]
Parse a hex color string into RGB values, exiting on error.
- color_tools.cli_commands.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
- color_tools.cli_commands.is_valid_lch(lch_tuple)[source]
Validate if an LCh(ab) tuple is within the standard range. LCh tuple format: (L*, C*, h°)
- Parameters:
lch_tuple – Tuple or list of 3 numeric values
- Return type:
- Returns:
True if valid LCh values, False otherwise
- color_tools.cli_commands.get_program_name()[source]
Determine the proper program name based on how we were invoked.
- Return type:
- Returns:
Program name to display in help text
- color_tools.cli_commands.show_override_report(json_dir=None)[source]
Show detailed report of user overrides and exit.
Analyzes user-colors.json and user-filaments.json to show what core data is being overridden, including conflicts by name and RGB values.
- color_tools.cli_commands.generate_user_hashes(json_dir=None)[source]
Generate .sha256 files for all user data files and exit.
Creates hash files for user/user-colors.json, user/user-filaments.json, and user/user-synonyms.json if they exist.
- color_tools.cli_commands.get_available_palettes(json_path=None)[source]
Get list of available palette names from both core and user palettes with color counts.
- color_tools.cli_commands.handle_verification_flags(args)[source]
Handle all verification flags and early-exit conditions.
Returns True if the program should exit after verification, False otherwise.
- Parameters:
args – Parsed command-line arguments from argparse
- Returns:
True if program should exit (verification-only mode or early exit flag)
- Return type: