Skip to main content

A python module to color your terminal output life

Project description

Setup

pip3 install colorifix

Requirements

  • Python 3.6+

Import

from colorifix.colorifix import paint, random, sample
from colorifix.colorifix import Color, Background, Style

Usage

There are 2 main functions, one to color a string and one to randomize color, background and style of a string.

from colorifix.colorifix import paint, random
from colorifix.colorifix import Color, Background, Style

paint('String to color',color=Color.RED)
paint('String to color',background=Background.GREEN,style=(Style.BOLD,Style.UNDERLINE))
paint('String to color',color=34,background=27)

random('YOLO',color=True,background=True)
random('YOLO',color=True,style=True)
random('YOLO',background=True)

Colors

You can choose from the default colors for text and background
RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, GRAY and BLACK or a number between 0 and 256.

For styles you can choose from
BOLD, UNDERLINE, DIM, BLINK, REVERSE and HIDDEN.

Sample

To disaply all different colors you can use the function sample

from colorifix.colorifix import sample

sample('color')            # default colors
sample('background')
sample('style')
sample('color',True)       # all colors
sample('background',True)

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

colorifix-1.0.8.tar.gz (3.5 kB view hashes)

Uploaded Source

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