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, then user is set to False. Files must have the extension .txt and should contain one line per color in the format name : hex. Whitespace is ignored.

  • user (bool, optional) – Whether to reload colors from user_folder. Default is False if positional arguments were passed and True otherwise.

  • default (bool, optional) – Whether to reload the default colors packaged with proplot. Default is always False.

  • space ({'hcl', 'hsl', 'hpl'}, optional) – The colorspace used to select “perceptually distinct” colors from the XKCD color survey. Default is 'hcl'. If passed then default is set to True.

  • 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 between 0 and 1 (0 will register all colors). Default is 0.1. If passed then default is set to True.

  • **kwargs – Additional color name specifications passed as keyword arguments rather than positional dictionaries.