Handles cleaning user input for colour formats.
Its purpose is to strip unit symbols (%, º, deg) from numeric values so that format modules can parse them without errors.
Summary
Functions
Cleans a string by removing common unit suffixes. Examples
Cleans a list of strings or a delimiter-separated string. Useful for inputs like "360º, 50%, 50%".
Functions
Cleans a string by removing common unit suffixes. Examples:
- "360º" -> "360"
- "50%" -> "50"
- "12.5 deg" -> "12.5"
@spec sanitize_list(any(), String.t()) :: {:ok, [String.t()]} | :error
@spec sanitize_list([String.t()], nil) :: {:ok, [String.t()]} | :error
Cleans a list of strings or a delimiter-separated string. Useful for inputs like "360º, 50%, 50%".