Colorlover: Color Scales for Python

0.3.0 · maintenance · verified Thu Apr 16

Colorlover is a Python library providing a collection of qualitative, sequential, and diverging color scales, originally designed for use with IPython notebooks. It offers utilities for converting between RGB and HSL color formats, generating numeric representations, and outputting scales as HTML. The library's current version is 0.3.0, released in January 2019, and it appears to be in a maintenance state with no recent active development.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import `colorlover`, access a predefined color scale, and convert it between different color representations (RGB string, numeric RGB, HSL string).

import colorlover as cl

# Access a diverging color scale with 3 colors
scale_rgb_str = cl.scales['3']['div']['RdYlBu']
print(f"RGB string scale: {scale_rgb_str}")

# Convert to numeric RGB tuples
scale_numeric_rgb = cl.to_numeric(scale_rgb_str)
print(f"Numeric RGB scale: {scale_numeric_rgb}")

# Convert to HSL strings
scale_hsl_str = cl.to_hsl(scale_rgb_str)
print(f"HSL string scale: {scale_hsl_str}")

view raw JSON →