RandomColor Module
The performance of the six functions ( frd2b, frb2d, brd2b, brb2d, bgrandomclr, and fgrandomclr ) is dependent on randomness.
The RandomColor Module’s fgrandomclr() function
Based on the provided text, it returns a string of randomly colored ForeGround text (stringType).fgandomclr means foreground random color.
Function’s structure:
Defined as: def fgrandomclr(String: str) -> str
Example:
Python3
from Designer.RandomColor import * print (fgrandomclr( """ Python is a high-level, \ general-purpose programming language. Its design philosophy emphasizes code readability \ with the use of significant indentation. Python is dynamically-typed and garbage-collected. \ It supports multiple programming paradigms, including structured (particularly procedural), \ object-oriented and functional programming. It is often described as a "batteries included" \ language due to its comprehensive standard library. """ )) |
Output:
The RandomColor Module’s bgrandomclr() function :
Using the provided text as the basis, it returns random colored BackGround(stringType) text. bgrandomclr means background random color.
Function’s structure:
Defined as: def bgrandomclr(String: str) -> str
Example:
Python3
from Designer.RandomColor import * print (bgrandomclr( """ Python is a high-level, \ general-purpose programming language. Its design philosophy emphasizes code readability \ with the use of significant indentation. Python is dynamically-typed and garbage-collected. \ It supports multiple programming paradigms, including structured (particularly procedural), \ object-oriented and functional programming. It is often described as a "batteries included" \ language due to its comprehensive standard library. """ )) |
Output:
The RandomColor Module’s brb2d() function
It will return the specified text’s bright to dull color as the background color. brb2d means background bright to a dull color.
Function’s structure: brb2d(String: str) -> str
Example:
Python3
from Designer.RandomColor import * print (brb2d( """ Python is a high-level, general-purpose programming language.""" )) |
Output:
The RandomColor Module’s brd2b() function
It will restore the specified text’s dull to bright color as the background. brd2b means background bright to dull text.
Function’s structure: brd2b(String: str) -> str
Example:
Python3
from Designer.RandomColor import * print (brd2b( """ Python is a high-level, general-purpose programming language.""" )) |
Output:
The RandomColor Module’s frb2d() function
It will change the text color for ForeGround from bright to dull. frb2d means foreground bright to dull text.
Function’s structure: frb2d(String: str) -> str
Example:
Python3
from Designer.RandomColor import * print (frb2d( """ Python is a high-level, general-purpose programming language.""" )) |
Output:
The RandomColor Module’s frd2b() function :
It will change the text for ForeGround from a dull to a bright color. frd2b means foreground dull to a bright color text.
Function’s structure:
Defined as: def frd2b(String: str) -> str
Example:
Python3
from Designer.RandomColor import * print (frd2b( """ Python is a high-level, \ general-purpose programming language.""" )) |
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