Skip to main content

A small colorful module to change text colors in terminal

Project description

Chroma Console

Chroma console is a python package for adding color and style to terminal text output using ANSI escape codes.

  • if requests is installed this package updates automaticaly

Installation

pip install chromaconsole

Functions

Style.disable()
Style.enable()
Style.reset()
Style.bold()
Style.faint()
Style.italic()
Style.underline()
Style.slow_blink()
Style.rapid_blink()
Style.reverse()
Style.hidden()
Style.strikethrough()
Style.not_bold()
Style.normal_intensity()
Style.not_italic()
Style.not_underline()
Style.not_blinking()
Style.proportional_spacing()
Style.not_reversed()
Style.reveal()
Style.not_strikethrough()
Style.not_proportional_spacing()
Style.overlined()
Style.not_overlined()
Style.minecraft(*args)
Color.text(*args)
Color.default_text()
Color.background(*args)
Color.default_background()

Example usage

from chromaconsole import Color, Style

print(f"{Color.text(r, g, b)}here is RGB colored text{Style.reset()}")
print(f"{Color.background(r, g, b)}here is RGB colored background{Style.reset()}")

print(f"{Color.text('#rrggbb')}here is HEX colored text{Style.reset()}")
print(f"{Color.background('#rrggbb')}here is HEX colored background{Style.reset()}")

print(f"{Style.bold()}Bold {Style.reset()}")
print(f"{Style.italic()}Italic {Style.reset()}")
print(f"{Style.underline()}Underline {Style.reset()}")
print(f"{Style.strikethrough()}Strikethrough {Style.reset()}")

print(f"{Style.bold()}{Style.italic()}bold+italic {Style.reset()}")
print(f"{Style.minecraft('§','§ahello §4world§r')}")

.enable() and .disable():

After executing the Style.disable() command, the system will no longer apply coloring and styling to the content. To re-enable these features, simply use the Style.enable() command.

#disable the coloring and styling
Style.disable()
print(f"{Color.text(r, g, b)}text without color and style{Style.reset()}")
Style.enable()
print(f"{Color.text(r, g, b)}text with color and style{Style.reset()}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chromaconsole-0.3.5.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

chromaconsole-0.3.5.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file chromaconsole-0.3.5.1.tar.gz.

File metadata

  • Download URL: chromaconsole-0.3.5.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for chromaconsole-0.3.5.1.tar.gz
Algorithm Hash digest
SHA256 63a1d6b4e96a7cd0383087d34712d2c8aad8760e486b05baa5c304e32f05f55e
MD5 5f9f36a3319e8369208fdeab15495566
BLAKE2b-256 7f4c240cc2f3c2d61a6edb5faa159dd1653c5c32f413d0a4558c682822827f58

See more details on using hashes here.

File details

Details for the file chromaconsole-0.3.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for chromaconsole-0.3.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2310ede053444b839c99d4615b812ae8d05a013150c787cbba182f8ac0be941d
MD5 ac877bc314f050686b4f0b280c4b3dc8
BLAKE2b-256 42f960ec86a55d27e239b37f567bd4a023c0201b2da6e1cf3dd1318db2075ff7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page