ragraph.colors.cubehelix#

Cubehelix color palette support.

Green, D. A. (2011). A colour scheme for the display of astronomical intensity images. Bull. Astr. Soc. India. Retrieved from http://www.astro.caltech.edu/

Module Contents#

Functions#

cubehelix_palette(→ List[str])

Calculate a cubehelix color palette as a list of hex codes.

_cubehelix_numpy(→ List[List[float]])

See cubehelix_palette.

_cubehelix_pure_python(→ List[List[float]])

See cubehelix_palette.

_linspace(→ List[float])

Linspace between lower and upper bound (inclusive) without Numpy.

_shuffle(→ List)

Shuffle items from by iterating between splits of the items.

Attributes#

HAVE_NUMPY

ragraph.colors.cubehelix.HAVE_NUMPY = True#
ragraph.colors.cubehelix.cubehelix_palette(n_colors: int, start: float = 2.25, end: float = 3.45, dark: float = 0.2, light: float = 0.85, gamma: float = 1.0, saturation: float = 1.2, rotations: Optional[float] = None, categorical: bool = False) List[str]#

Calculate a cubehelix color palette as a list of hex codes.

Parameters:
  • n_colors – Number of RGB colour pairs to generate.

  • start – Starting color (Red: 1.0, Green: 2.0, Blue: 3.0).

  • end – Final color (Red: 1.0, Green: 2.0, Blue: 3.0).

  • dark – Lightness of the darkest value [0.0 - 1.0].

  • light – Lightness of the lightest value [0.0 - 1.0].

  • gamma – Exponential factor applied to lightness to emphasize low intensity values (< 1.0) or high intensity values (> 1.0).

  • rotations – Number of RGB rotations (1.0 means a full RGB rotation). Overrides end. Otherwise calculated as (end - start) / 3.

  • categorical – Whether to shuffle the rotational space optimally for categorical color palettes. Similar colors are positioned as far apart as possible.

Returns:

Color palette as a list of hex codes.

Reference:

Green, D. A. (2011). A colour scheme for the display of astronomical intensity images. Bull. Astr. Soc. India. Retrieved from http://www.astro.caltech.edu/

ragraph.colors.cubehelix._cubehelix_numpy(n_colors: int, start: float = 2.25, end: float = 3.45, dark: float = 0.2, light: float = 0.85, gamma: float = 1.0, saturation: float = 1.2, rotations: Optional[float] = None, categorical: bool = False) List[List[float]]#

See cubehelix_palette.

ragraph.colors.cubehelix._cubehelix_pure_python(n_colors: int, start: float = 2.25, end: float = 3.45, dark: float = 0.2, light: float = 0.85, gamma: float = 1.0, saturation: float = 1.2, rotations: Optional[float] = None, categorical: bool = False) List[List[float]]#

See cubehelix_palette.

ragraph.colors.cubehelix._linspace(lower: float, upper: float, n: int) List[float]#

Linspace between lower and upper bound (inclusive) without Numpy.

ragraph.colors.cubehelix._shuffle(items: List, n_splits: int = 2) List#

Shuffle items from by iterating between splits of the items.