Skip to main content

Python package to change the text color of the python console.

Project description

🎨 Colorway

Python package to change the text color of the python console.

📦 Installation

Run the following to install:

$ pip install colorway

🚀 Usage

Foreground

from colorway_foreground import *

# Generate red text with default background
print(red_fg("Hello, World!"))

# Generate bold red text with default background
print(bold_red_fg("Hello, World!"))

# Generate high-intensity red text with default background
print(highintensity_red_fg("Hello, World!"))

# Generate high-intensity bold red text with default background
print(highintensity_bold_red_fg("Hello, World!"))

# Generate custom colored text (red: 150, green: 78, blue: 120) with default background
print(custom_fg(150,78,120,"Hello, World!"))

Background

from colorway_background import *

# Generate text with red background
print(red_bg("Hello, World!"))

# Generate text with high-intensity red background
print(highintensity_red_bg("Hello, World!"))

# Generate text with custom colored background (red: 150, green: 78, blue: 120)
print(custom_bg(150,78,120,"Hello, World!"))

Foreground & Background

You can use foreground formatting and background formatting by placing them in each other.

from colorway_foreground import *
from colorway_background import *

# Generate red text with blue background
print(red_fg(blue_bg("Hello, World!")))

Manual

You can also use the manual package to manually format parts of strings.

from colorway_manual import *

# Generate red text
print(f'{foreground.red}Hello, World!{format.clear}')

# Generate text with red background
print(f'{background.red}Hello, World!{format.clear}')

# Generate text with a mix of colors
print(f'{foreground.red}Hello, {background.blue}World!{format.clear}')

Available colors

The colors available to use are:

  • ⬛ Black
  • 🟥 Red
  • 🟩 Green
  • 🟨 Yellow
  • 🟦 Blue
  • 🟪 Purple
  • 🟦 Cyan
  • ⬜ White

Note

Please be aware that you can not combine foreground and background formatting if you use high-intensity colors.
Please be aware that custom colors may not be supported by all terminal outputs.

👨‍💻 Developing Colorway

To install colorway, along with the tools you need to develop and run tests, run the following in your virtualenv:

$ pip install -e .[dev]

🚦 Development Progress

Stable Development

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

colorway-2.0.0.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

colorway-2.0.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file colorway-2.0.0.tar.gz.

File metadata

  • Download URL: colorway-2.0.0.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for colorway-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d8123767802703dde1d5b9bdc2246db73b53e298883b5627639bc5b331a25ff5
MD5 8f262e182fb9d64a0494d4c8890ed20e
BLAKE2b-256 e6b5832a9338a4732d0146cf22bf41fb1aa5716428bfc4c0fd941d859c3faad2

See more details on using hashes here.

File details

Details for the file colorway-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: colorway-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for colorway-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a7c73ecdb6048eda790a8a257fce48f18a3bacf3e76a96f0702d210165cd061
MD5 4b86f73d361d9a30ba7f2aaaccd836f4
BLAKE2b-256 62d6e71ecbafcb54519c9b5a3d63189456d75e0ce6c0c05833fa346b6a0a8fa8

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