Description: |
An extension of the standard colorsys module with support for CMYK, terminal colors, ANSI and more. |
Latest Version: |
2013 |
Architecture: |
|
Dependencies: |
|
Arch Repositories: |
|
AUR ID: |
|
Arch Forum ID: |
|
Tags: |
Colorsysplus is a extension of the standard colorsys module. It provides RGB conversion functions for
The module is a receptacle for color conversion functions that I frequently found myself copying or rewriting. I will continue to add to it and improve it. If you have suggestions of what to include, please let me know.
The source code is reasonably documented and straight-forward. The default main routine provides a simple example of converting HSV values to the nearest ANSI escape codes.
The package also includes the ColorizedText module that provides a class of the same name for working with colorized text. Text is stored as a list of chunks with associated RGB values that can be easily manipulated in an output-agnostic way.
The class includes methods for converting to and from the following formats:
It also includes some convenience functions for applying gradients of different types.
The code for retrieving RGB values for ANSI escape codes in the running terminal was adapted from code posted by Lux Perpetua on the Arch Linux forum
Only some ANSI escapes are currently recognized when attempting to parse an ANSI string. This functionality is provided by colorsys and improving it is on my TODO list.↩