forked from hykilpikonna/hyfetch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
37 lines (27 loc) · 976 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from hyfetch.color_util import RGB, printc
from hyfetch.neofetch_util import get_command_path, run_neofetch
from hyfetch.presets import PRESETS
def print_colors_test(colors: list[RGB]):
print(''.join(f'{c.to_ansi_rgb()}#' for c in colors))
def test_preset_length():
p = PRESETS.get('transgender')
print_colors_test(p.with_length(9))
print_colors_test(p.with_length(6))
p = PRESETS.get('nonbinary')
print_colors_test(p.with_length(7))
print_colors_test(p.with_length(6))
def test_command_path():
print(get_command_path())
def test_rgb_8bit_conversion():
for r in range(0, 255, 16):
for g in range(0, 255, 16):
print(RGB(r, g, 0).to_ansi_rgb(False), end=' ')
printc('&r')
print()
for r in range(0, 255, 16):
for g in range(0, 255, 16):
print(RGB(r, g, 0).to_ansi_8bit(False), end=' ')
printc('&r')
print()
if __name__ == '__main__':
test_rgb_8bit_conversion()