Skip to main content

A Python module to make text styling easy. Works in all versions of Python, build with escape codes and spaces.

Project description

coolours-logo

Coolours

A Python Module To Make Text Styling Easy

Made By Alex Hawking

Installation

With Pip

Install with:

pip install coolours

or

pip3 install coolours

With wget

Wget must be installed

cd ~/Library/Python/3.7/lib/python/site-packages && wget https://raw.githubusercontent.com/Handmade-Studios/coolours-module/master/coolours/coolours.py && cd ~

Probably easier to copy and paste that ^

Usage

Importing

Import coolours using:

from coolours.colour import *

You can import with

import coolours.colour

But that requires you to use print(coolours.colour('style', 'textcolour', 'backgroundcolour')), so I think it is easier to use the first method.

Colours

You use coolours within the print function as shown below:

print(colour('style', 'text-colour', 'background-colour') + 'your text')

Make sure you place the colours and styles within quotes

Alignment

  • Center

To center text use:

print(center('yourtext'))
  • Right

To align text to the right use:

print(right('yourtext'))
  • With Colour

To use alignment with colour:

print(colour('style', 'textcolour', 'bgcolour') + center('yourtext'))

Default

To make the colours back to default after the coloured text add default to the end of the print function:

print(colour('style', 'text-colour', 'background-colour') + 'your text' + default)

Updating

To update use:

pip install --upgrade coolours

Or:

pip3 install --upgrade coolours

List of Colours

Coolours contains the following colours:

Styles

  • none
  • bold
  • underline (not supported in all temrinals)
  • blink (not supported in all terminals)

Text Colours

  • none
  • black
  • red
  • green
  • yellow
  • blue
  • purple
  • cyan
  • white
  • brightblack
  • brightred
  • brightgreen
  • brightyellow
  • brightblue
  • brightpurple
  • brightcyan
  • brightwhite

Background Colours

  • none
  • black
  • red
  • green
  • yellow
  • blue
  • purple
  • cyan
  • white
  • brightblack
  • brightred
  • brightgreen
  • brightyellow
  • brightblue
  • brightpurple
  • brightcyan
  • brightwhite

Alignments

  • Right
  • Center

Future

More colours and styles coming soon. Will add some sort of fancy text.

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

coolours-0.6.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

coolours-0.6-py3-none-any.whl (4.4 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