register_colors¶
- register_colors(*args, user=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, thenuser
is set toFalse
. Files must have the extension.txt
and should contain one line per color in the formatname : hex
. Whitespace is ignored.user (
bool
, optional) – Whether to reload colors fromuser_folder
. Default isFalse
if positional arguments were passed andTrue
otherwise.default (
bool
, optional) – Whether to reload the default colors packaged with ProPlot. Default is alwaysFalse
.space (
{'hcl', 'hsl', 'hpl'}
, optional) – The colorspace used to select “perceptually distinct” colors from the XKCD color survey. Default is'hcl'
. If passed thendefault
is set toTrue
.margin (
float
, optional) – The margin by which the normalized hue, saturation, and luminance of each XKCD color must differ from the channel values of the other XKCD colors to be deemed “perceptually distinct” and registered. Must fall between0
and1
(0
will register all colors). Default is0.1
. If passed thendefault
is set toTrue
.**kwargs – Additional color name specifications passed as keyword arguments rather than positional dictionaries.