test.py 976 B

12345678910111213141516171819202122232425262728293031323334353637
  1. from hyfetch.color_util import RGB, printc
  2. from hyfetch.neofetch_util import get_command_path, run_neofetch
  3. from hyfetch.presets import PRESETS
  4. def print_colors_test(colors: list[RGB]):
  5. print(''.join(f'{c.to_ansi_rgb()}#' for c in colors))
  6. def test_preset_length():
  7. p = PRESETS.get('transgender')
  8. print_colors_test(p.with_length(9))
  9. print_colors_test(p.with_length(6))
  10. p = PRESETS.get('nonbinary')
  11. print_colors_test(p.with_length(7))
  12. print_colors_test(p.with_length(6))
  13. def test_command_path():
  14. print(get_command_path())
  15. def test_rgb_8bit_conversion():
  16. for r in range(0, 255, 16):
  17. for g in range(0, 255, 16):
  18. print(RGB(r, g, 0).to_ansi_rgb(False), end=' ')
  19. printc('&r')
  20. print()
  21. for r in range(0, 255, 16):
  22. for g in range(0, 255, 16):
  23. print(RGB(r, g, 0).to_ansi_8bit(False), end=' ')
  24. printc('&r')
  25. print()
  26. if __name__ == '__main__':
  27. test_rgb_8bit_conversion()