sciris.ansicolors

Copy of Jonathan Eunice and Georgios Verigakis’ ansicolors Python module: https://pypi.org/project/ansicolors/

Included here to avoid an additional dependency.

Functions here are not intended for direct use by the user, but of course they can be.

New in version 2.0.0.

Functions

ansilen

Given a string with embedded ANSI codes, what would its length be without those codes?

color

Add ANSI colors and styles to a string.

parse_rgb

Convert string to an RGB color

strip_color

Remove ANSI color/style sequences from a string.