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

>#styling
Style.disable()
Style.enable()
Style.reset()
Style.bold()
Style.faint()
Style.italic()
Style.underlined()
Style.slow_blink()
Style.rapid_blink()
Style.reverse()
Style.hidden()
Style.strikethrough()
Style.doubly_underlined()
Style.normal_intensity()
Style.not_italic()
Style.not_underlined()
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)

>#coloring
Color.text(*args)
Color.default_text()
Color.background(*args)
Color.default_background()
Color.text_black()
Color.text_red()
Color.text_green()
Color.text_yellow()
Color.text_blue()
Color.text_magenta()
Color.text_cyan()
Color.text_white()
Color.bg_black()
Color.bg_red()
Color.bg_green()
Color.bg_yellow()
Color.bg_blue()
Color.bg_magenta()
Color.bg_cyan()
Color.bg_white()

>#some other things
Console.clr_scr_to_end()
Console.clr_scr_to_begin()
Console.clr_entire_scr()
Console.clr_line_to_end()
Console.clr_line_to_begin()
Console.clr_entire_line()
Console.scroll_up(int)
Console.scroll_down(int)
Console.bell()
Console.save_cursor()
Console.restore_cursor()
Console.switch_alt_scr()
Console.switch_orig_scr()
Console.show_cursor()
Console.hide_cursor()

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.underlined()}Underlined {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.4.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chromaconsole-0.4-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for chromaconsole-0.4.tar.gz
Algorithm Hash digest
SHA256 f347306b11e56b8f7cf31db2ac097bd733b1037b9f61101617b7cbffd6f0b714
MD5 13868e41dfc791a60518e09bfe3bc74e
BLAKE2b-256 6b6150b898b8ce04883d5946362411548b4302b03b5bde8f09c456884ddd7dd0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chromaconsole-0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for chromaconsole-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 29c03339dc504e479ac06f00209c7e5a2440a778138d1466dc440c5ff24fea3d
MD5 f6d50890536103d6a37a7fda023b880b
BLAKE2b-256 5e6beb576da482dfafd57e49e5241a72082359d10047268c3a71d647365b77cd

See more details on using hashes here.

Supported by

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