Easy and powerful Colorizer for Python!
Project description
IRO
Easy and powerful Colorizer for Python!
Powered by Yamato Nagata
from iro import Iro, Color, Style, ColorRGB, Color256
from colorsys import hls_to_rgb
success = Iro((Color.GREEN, "[ SUCCESS ]"))
error = Iro((Color.WHITE, Style.DOUBLY_UNDERLINE, ColorRGB(255, 0, 0, bg=True), "[ ERROR ]"), disable_rgb=False)
warning = Iro((Color.YELLOW, Color256(255, bg=True), "[ WARNING ]"))
deprecated = Iro((Color256(7), Color256(239, True), Style.STRIKE, "[DEPRECATED]"))
print(success, 'code success.')
print(error, 'code failed!!')
print(warning, 'maybe something wrong.')
print(deprecated, 'this function is deprecated.')
print(Iro([
Color.RED, "Off course, You can nest styles. ",
[
Style.ITALIC,
"This is RED and ITALIC. "
],
[
Color.BLUE,
Color.BG_BRIGHT_YELLOW,
Style.UNDERLINE,
"This is BLUE, BG_YELLOW and UNDERLINED."
],
" Finally back to only RED!"
]))
for h in range(256):
print(Iro([ColorRGB(*map(lambda x: x * 255, hls_to_rgb(h / 256, 0.7, 1)), bg=True), ' '], disable_rgb=False), end='')
output
Installation
$ pip install iro
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Iro-0.5.0.tar.gz
(7.0 kB
view hashes)
Built Distribution
Iro-0.5.0-py3-none-any.whl
(7.1 kB
view hashes)