Logo

index : 0x2lib

Library extension for Jai

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/0x2lib.git/html/tests/termcolors.jai blob: 781ca0eedd8546c37c8f2fbfd6ae3e0ac4936630 [raw] [clear marker]

        
0
1
2
3tests_visual :: () {
4 log("--- paint() -----------------------------");
5 log(paint("1 Plain"));
6 print("\n");
7
8 log(paint("2 Bold, fg Black", .BOLD, .BLACK));
9 print("\n");
10
11 log(paint("3 fg Black", .RESET, .BLACK));
12 print("\n");
13
14 log(paint("4 Bold, fg Black, bg White", .BOLD, .BLACK, .WHITE));
15 print("\n");
16
17 log(paint("5 Bold, Underline, Italic, fg Black, bg White", .[.BOLD, .UNDERLINE, .ITALIC], .BLACK, .WHITE));
18 print("\n\n");
19
20 log("--- paint_ex() -----------------------------");
21 log(paint_ex("6 Underline, fg GreenDark, bg OrangeLight", .UNDERLINE, .GREEN_DARK, .ORANGE_LIGHT));
22 print("\n");
23
24 log(paint_ex("7 Underline, fg GreenDark", .UNDERLINE, .GREEN_DARK));
25 print("\n");
26
27 log(paint_ex("8 Bold, Underline, Italic, fg GreenDark, bg OrangeLight", .[.BOLD, .UNDERLINE, .ITALIC], .GREEN_DARK, .ORANGE_LIGHT));
28 print("\n");
29
30 log(paint_ex("9 Underline, fg 84, bg 124", .UNDERLINE, 84, 124));
31 print("\n");
32
33 log(paint_ex("10 Bold, Underline, Italic, 84, 124", .[.BOLD, .UNDERLINE, .ITALIC], 84, 124));
34 print("\n\n");
35
36 log("--- paint_ex_custom() -----------------------------");
37 My_Colors :: enum #specified {
38 NONE :: -1;
39 COL1 :: 95;
40 COL2 :: 201;
41 }
42
43 log(paint_ex_custom("11 Underline, fg Custom, bg Custom", .UNDERLINE, My_Colors.COL1, My_Colors.COL2));
44 print("\n\n");
45
46 log("--- paint_rgb() -----------------------------");
47 log(paint_rgb("12 Underline, fg rgb(255,0,0), bg rgb(0,0,255)", .UNDERLINE, .{ 255, 0, 0 }, .{ 0, 0, 255 }));
48 print("\n");
49
50 log(paint_rgb("13 Bold, Underline, Italic, fg rgb(255,0,0), bg rgb(0,0,255)", .[.BOLD, .UNDERLINE, .ITALIC], .{ 255, 0, 0 }, .{ 0, 0, 255 }));
51 print("\n\n");
52
53 log("--- paint_raw() -----------------------------");
54 log(paint_raw("1;3;32;45", "14 tbd tbd tbd", no_termination = false));
55 print("\n\n");
56}
57
58
59#scope_file
60
61
62#import "Basic";
63#import,file "../0x2_Termcolors.jai";
64
65
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit