Debian Codegraph @

tests/test_cprint.py

raw symbols SCIP
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 """ Test cprint(text: str,
5 fore_256: int | str = '',
6 back_256: int | str = '',
7 fore_rgb: tuple = (255, 255, 255),
8 back_rgb: tuple = (0, 0, 0),
9 formatting: int | str = '',
10 line_color: int | str = '',
11 reset=True,
12 **kwargs) function.
13 """
14
15 import random
16 from colored.library import Library
17 from colored.cprint import cprint
18
19
20 def main():
21
22 for color in Library.COLORS.values():
23 back: int = random.randint(0, 255)
24 a: int = random.randint(0, 255)
25 b: int = random.randint(0, 255)
26 c: int = random.randint(0, 255)
27 style: str = random.choice(list(Library.STYLES.values()))
28 cprint(' Hello World or World Hello? ', fore_256=color, back_256=back, formatting=style)
29 cprint(' Hello World or World Hello? ', fore_rgb=(a, b, c), back_rgb=(c, b, a), formatting=style)
30
31
32 if __name__ == '__main__':
33 main()