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, 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.

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

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

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

  • 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 by margin in order to be registered. Must fall between 0 and 1 (0 will register all colors). If passed then default is set to True.

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