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.bold()
Style.italic()
Style.underline()
Style.strikethrough()
Style.negative()
Style.normal()
Style.reset()
Style.slowblink()
Style.rapidblink()
Style.hidden()
Style.minecraft(*args)
Style.enable()
Style.disable()
Color.text(*args)
Color.background(*args)

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{Style.reset()}")
Style.enable()
print(f"{Color.text(r, g, b)}text with color{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.2.5.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

chromaconsole-0.3.2.5-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for chromaconsole-0.3.2.5.tar.gz
Algorithm Hash digest
SHA256 7771237e3d5cca7ed34bbd3390b9c465260916cb9a313f94ea8a8bb83e133091
MD5 c8663f804218b9c1c40f8c80b9297e69
BLAKE2b-256 9d8c45f577f505f30a5fc128e56b87889eca1a2853fa266fe9afa75dd49fda0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chromaconsole-0.3.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 700d78cb40e2f57ebe91d9c865d25b598b61d5ee63d8b444fe2f85e25febe3d4
MD5 1fbeb60e92963694830177da2b306e3d
BLAKE2b-256 02c46b80fb29464bb40114e74f3cebb587c55385f41f735e5b1e887b5ea41a14

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