|
1 |
| -# terminalcolor |
| 1 | +# **termicol** |
| 2 | +A [**python**](https://www.python.org) Simple **python** function aimed to handle printing of colored and / or decorated text to console / terminal. |
| 3 | +<br /> |
| 4 | +<br /> |
| 5 | +<br /> |
| 6 | +## Installation |
| 7 | +With `git` [GitHub](https://github.com/irtsa-dev/termicol): |
| 8 | +``` |
| 9 | +git clone https://github.com/irtsa-dev/termicol.git |
| 10 | +``` |
| 11 | +<br /> |
| 12 | +<br /> |
| 13 | +<br /> |
| 14 | +<br /> |
| 15 | +<br /> |
| 16 | +<br /> |
| 17 | + |
| 18 | +## Usage |
| 19 | +To import: |
| 20 | +```py |
| 21 | +from termicol.termicol import * |
| 22 | +``` |
| 23 | +<br /> |
| 24 | + |
| 25 | +Then, later on you may utilize: |
| 26 | +```py |
| 27 | +tprint(content: str, end: str = '\n') |
| 28 | +# Prints off text and background in the given color with provided decorations. |
| 29 | +# To do so, <> is used similar to html. |
| 30 | +# Example being: <t=white>hello |
| 31 | + |
| 32 | +printRGBColor(text: str, textRGB: tuple, backgroundRGB: tuple = (), decorations: list | str = [], end: str = '\n') |
| 33 | +# Prints off text and background in the given rgb value with provided decorations. |
| 34 | + |
| 35 | + |
| 36 | +showColorList() |
| 37 | +# Prints off a list of valid arguments for color. |
| 38 | + |
| 39 | +showDecorationList() |
| 40 | +# Prints off a list of valid arguments for decoration. |
| 41 | +``` |
| 42 | + |
| 43 | +<br /> |
| 44 | +<br /> |
| 45 | +### Code Examples |
| 46 | +```py |
| 47 | +from termicol.termicol import tprint |
| 48 | + |
| 49 | +tprint("<t=red>hello, this text will be red!") |
| 50 | +``` |
| 51 | +```py |
| 52 | +from termicol.termicol import * |
| 53 | + |
| 54 | +tprint("<t=blue>this text will be blue,<t=red> While this text will be red!") |
| 55 | +``` |
| 56 | +```py |
| 57 | +from termicol.termicol import * |
| 58 | + |
| 59 | +tprint("<t=red><b=blue><d=underline>This will be underlined red text with blue background!") |
| 60 | +``` |
| 61 | + |
| 62 | +<br /> |
| 63 | +<br /> |
| 64 | +### Additional Notes |
| 65 | +Valid tags to utilize: |
| 66 | +- t | textcolor |
| 67 | + - Will change the text color, can either be one of the valid color arguments that are seen in `showColorList()` function or a list of 3 values separated by a comma for rgb values. |
| 68 | + - \<t=red\> | \<t=20,2,30\> |
| 69 | +- b | bgcolor | backgroundcolor |
| 70 | + - Will change the background color, can either be one of the valid color arguments that are seen in `showColorList()` function or a list of 3 values separated by a comma for rgb values. |
| 71 | + - \<b=red\> | \<b=20,2,30\> |
| 72 | +- d | deco | decorations |
| 73 | + - Will add in decorations based on what is provided, must be ones provided in the `showDecorationList()` function. |
| 74 | + - \<d=underline\> | \<d=underline,italic\> |
0 commit comments