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, 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.local (
bool
, optional) – Whether to reload colors fromlocal_folders
. Default isFalse
if positional arguments were passed andTrue
otherwise.default (
bool
, default:False
) – Whether to reload the default colors packaged with proplot. Default is alwaysFalse
.space (
{'hcl', 'hsl', 'hpl'}
, optional) – The colorspace used to pick “perceptually distinct” colors from the XKCD color survey. If passed thendefault
is 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 bymargin
in order to be registered. Must fall between0
and1
(0
will register all colors). If passed thendefault
is set toTrue
.**kwargs – Additional color name specifications passed as keyword arguments rather than positional argument dictionaries.