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 details)

Uploaded Source

Built Distribution

coolours-0.6-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file coolours-0.6.tar.gz.

File metadata

  • Download URL: coolours-0.6.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for coolours-0.6.tar.gz
Algorithm Hash digest
SHA256 8b3d5b9b8204003837461f79638b5fd0cd65113a2bf38e348ff8479d3ec9d98f
MD5 82ded1ede289693a73f2f36d0e8c806e
BLAKE2b-256 1905a1766ee0e58ccd527ebbe4d9c329112009debb65514d6f82419d7030f9c5

See more details on using hashes here.

File details

Details for the file coolours-0.6-py3-none-any.whl.

File metadata

  • Download URL: coolours-0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for coolours-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1dc0f2699d7746e9b5e4cce15d046f73b89ded928fa88ad5237dd47c3853d271
MD5 92eb89d7db25c20cec6840ca17fe369a
BLAKE2b-256 cc12063b20edf1273547e138eac12a81251cb1af6d0ab1877ae00acfb57b54a5

See more details on using hashes here.

Supported by

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