register_colors
- register_colors(*args, user=None, local=None, default=False, space=None, margin=None, **kwargs)[source]
Register named colors. This is called on import.
- Parameters:
*args (path-like or
dict, optional) – The colors to register. These can be file paths containing RGB data or dictionary mappings of names to RGB values. By default, if positional arguments are passed, thenuseris set toFalse. Files must have the extension.txtand should contain one line per color in the formatname : hex. Whitespace is ignored.user (
bool, optional) – Whether to reload colors fromuser_folder. Default isFalseif positional arguments were passed andTrueotherwise.local (
bool, optional) – Whether to reload colors fromlocal_folders. Default isFalseif positional arguments were passed andTrueotherwise.default (
bool, default:False) – Whether to reload the default colors packaged with ultraplot. Default is alwaysFalse.space (
{'hcl', 'hsl', 'hpl'}, optional) – The colorspace used to pick “perceptually distinct” colors from the XKCD color survey. If passed thendefaultis set toTrue.margin (
float, default:0.1) – The margin used to pick “perceptually distinct” colors from the XKCD color survey. The normalized hue, saturation, and luminance of each color must differ from the channel values of the prededing colors bymarginin order to be registered. Must fall between0and1(0will register all colors). If passed thendefaultis set toTrue.**kwargs – Additional color name specifications passed as keyword arguments rather than positional argument dictionaries.