colour.utilities.validate_method#
- colour.utilities.validate_method(method: str, valid_methods: tuple, message: str = '"{0}" method is invalid, it must be one of {1}!') str [source]#
Validate whether given method exists in the given valid methods and returns the method lower cased.
- Parameters:
- Returns:
Method lower cased.
- Return type:
- Raises:
ValueError – If the method does not exist.
Examples
>>> validate_method("Valid", ("Valid", "Yes", "Ok")) 'valid'