The BackGroundColor Module
The set_default_stylebg() method in the Background Module:
It only requires one parameter of the type int, and its return type is None. It is employed to alter the default values or set the style’s value to all colors. Using this function we can set a single style to all of the functions.
Styles: Normal = 0, Bold = 1, Light = 2, Italicized = 3, UnderLined = 4, Blink = 5
Example 1:
Python program to print colored text.
Python3
from Designer.BackGroundColor import * print (red1bg( 'some red text with Italicized' , 3 )) print (green1bg( 'and with a green background with bold' , 1 )) print (blue1bg( 'blue text' ), whitebg( 'hello' )) print (greenbg( "calling the functions will allow" ) + yellow1bg( " you to adjust the colours." )) print ( 'back to normal now' ) |
Output:
Example 2:
To make all of the text bold, use this set_default_stylebg() method.
Python3
from Designer.BackGroundColor import * set_default_stylebg( 1 ) print (greenbg( "This is" ),bluebg( "the" ) + brown3bg( "example" )) print (wheat2bg( "to" ),pinkbg( "set the default" ),greenbg( "style" )) |
Output:
Python terminal processing with TerminalDesigner module
In this article, we’ll look at how to use TerminalDesigner to produce colorful text for the terminal in Python. This module is quite compact. This module can be used to change the font’s color, style, and background, print images onto terminals for video playback, convert images to ASCII art and serve a variety of other functions. You can install the TerminalDesigner module in Python 3 by using the following command:
pip install TerminalDesigner
This module contains 5 Python files:
- BackGroundColor Module
- ForeGroundColor Module
- HexName Module
- RandomColor Module
- General Module
Contact Us