Git Product home page Git Product logo

pycolour's Introduction

pyColour

A python function file that colours output strings.


Contents

  1. Usage
  2. Commands
  3. Note

Usage

  1. Download the pyColour.py file into your project's directory, or use git: git clone https://github.com/blue-horizons/pyColour/blob/pyColour.py

  2. Call the file into your python project with

from pyColour import *
  1. Use the following commands in your code. Text colour, background colour and formatting can be used at the same time, by stacking (e.g. `bold(red(bgGreen("Hello world!"))))

NOTE: the outermost colour is the colour that the text will be displayed as (e.g. in yellow(red(green("hello")))), "hello" will be displayed in yellow.

Commands

Basic Colours

colour command
black black(string)
red red(string)
green green(string)
yellow yellow(string)
blue blue(string)
magenta magenta(string)
white white(string)

Bright Variants

colour command
bright black (grey 1) bright_black(string)
bright red bright_red(string)
bright green bright_green(string)
bright yellow bright_yellow(string)
bright blue bright_blue(string)
bright magenta bright_magenta(string)
bright white (grey 2) bright_white(string)

Other Formatting

Format Command
Bold bold(string)
Underline underline(string)
Reverse reverse(string)

256 Colour support

For custom colours, use the following command: colour_256(string, [0 -> 255])

Highlighting

Highlighting is also possible, and you can use the same commands as before, just with bg infront of it (i.e. bgBlue(string), bgBright_magenta(string))



Note

This project is loosely based on the idea of Simple Chalk.

pycolour's People

Contributors

jxctn0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.