Skip to main content

This is a simple package to print colored messages using ASCI to the terminal built with python 3.

Project description

terminalcolorpy

Open Source? Yes!

made-with-python

This is a simple package to print colored messages using ASCI to the terminal built with python 3.

Usage of terminalcolorpy

Usage of it is pretty straight-forward,

from terminalcolorpy import pcolor, prainbow

print(pc('Hello', color='#42f5d7',
         markup=['striked', 'bold', 'underline', 'italic'],
         highlight='#a8328b')
      )

TerminalColorPy has 2 main functions,

  • prainbow
  • pcolor

prainbow It's alias is pr, takes a single parameter which is text to return as rainbow.

pcolor It's alias is pc, takes 4 parameteres, which are:

  • text (mandatory)
  • color (mandatory)
  • highlight
  • markup

HighLight & Color take either a string, an RGB value or even a hex code. For example,

from terminalcolorpy import pcolor

print(pcolor('Hello', color='#42f5d7',
         markup=['striked', 'bold', 'underline', 'italic'],
         highlight='#42f5d7')
      )

print(pcolor('World', color='red',
         markup=['striked', 'bold'],
         highlight='blue')
      )

print(pcolor('World', color=[122, 99, 0],
         markup=['bold'],
         highlight=[122, 100, 78])
      )

List of accepted values

    highlight_values = [
        'gray',
        'pink',
        'black',
        'yellow',
        'green',
        'blue',
        'red'
    ]

    color_values = [
        'pink',
        'blue',
        'cyan',
        'green',
        'yellow',
        'red',
        'black',
        'orange'
    ]

    text_markup_values = [
        'bold',
        'underline',
        'italic',
        'striked'
    ]

Hex Generator https://www.google.com/search?q=hex+color

RGB Generator https://www.w3schools.com/colors/colors_rgb.asp

It works on any terminals that support ASCII codes, include but not limited to:

Terminals Works On
PyCharm True
Python IDLE False
Windows CMD False
MacOS iTerm2 True
VSCode True
Visual Studio Code True

i haven't really used anything else, this list is to expand

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

terminalcolorpy-0.0.7.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

terminalcolorpy-0.0.7-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

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