You are not logged in.
Project page: http://xyne.archlinux.ca/projects/python3-colorsysplus/
Over time I've written a lot of code to manage color conversions between different formats (hexadecimal, terminal, ANSI, CMYK, etc). Some of it has found its way into some of my projects (e.g. pychrom and tiv, both of which were written as afterthoughts from messing around with colors), but it's never really been directly accessible.
I finally got tired of cannibalizing my own code whenever I needed some conversion functions so I put everything in a single module and packaged it.
The source code is reasonably documented and relatively straight-forward, so it should be easy to use.
Anyone interested in this may also be interested in Lux Perpetua's script from which some of the code was adapted/cannibalized.
If you have any suggestions for additional functionality or ways that the existing code could be improved, let me know.
edit: screenshot
Last edited by Xyne (2012-10-22 07:50:07)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
The package now contains a supplementary module for working with colorized text. It can convert to and from HTML, BBCode, ANSI, etc. and provides some functions for applying custom gradients and other fun stuff. This text was generated with the code. It could have just as easily been display in a compatible terminal.
Yes, I am aware that I appear to have too much time on my hands. In fact, the opposite is true. This is the result of procrastination and escapism.
But hey, look at the pretty colors! No, not the clock, the colors!
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Shameless self-bump to say that I have moved the ANSI functions from python3-xcgf to python3-colorsysplus in case anyone needs some simple python functions for displaying colored terminal text with other common ANSI select graphics rendition options (bold, blink, negative).
Example:
#!/usr/bin/env python
from colorsysplus import ansi_sgr
s = ansi_sgr(fg='red', bold=True, blink=True) + \
'BLINKING TERMINAL TEXT IS ANNOYING, ISN\'T IT?' + \
ansi_sgr(reset=True)
print(s)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I had forgotten about this Xyne. Made my day
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Added a command-line utility for piping fun:
pacman --color always -Ss colorsys | ctconv ansi bbcode
xyne-x86_64/python3-colorsysplus 2013-5 [installed: 2015.12-1]
An extension of the standard colorsys module with support for CMYK, terminal colors, ANSI and more.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline