#import "Basic"()( MEMORY_DEBUGGER = MEMORY_DEBUGGER ); #import "termcolors"; MEMORY_DEBUGGER :: false; main :: () { #if MEMORY_DEBUGGER defer report_memory_leaks(); termcolors_init_allocator_and_context(); // Technically you don't need do reset the pool for this example. // But I keep it here, so you're aware of this procedure. defer termcolors_reset_pool(overwrite_memory = true); log("--- paint() -----------------------------"); log(paint("1 Plain")); print("\n"); log(paint("2 Bold, fg Black", .BOLD, .BLACK)); print("\n"); log(paint("3 fg Black", .RESET, .BLACK)); print("\n"); log(paint("4 Bold, fg Black, bg White", .BOLD, .BLACK, .WHITE)); print("\n"); log(paint("5 Bold, Underline, Italic, fg Black, bg White", .[.BOLD, .UNDERLINE, .ITALIC], .BLACK, .WHITE)); print("\n\n"); log("--- paint_ex() -----------------------------"); log(paint_ex("6 Underline, fg GreenDark, bg OrangeLight", .UNDERLINE, .GREEN_DARK, .ORANGE_LIGHT)); print("\n"); log(paint_ex("7 Underline, fg GreenDark", .UNDERLINE, .GREEN_DARK)); print("\n"); log(paint_ex("8 Bold, Underline, Italic, fg GreenDark, bg OrangeLight", .[.BOLD, .UNDERLINE, .ITALIC], .GREEN_DARK, .ORANGE_LIGHT)); print("\n"); log(paint_ex("9 Underline, fg 84, bg 124", .UNDERLINE, 84, 124)); print("\n"); log(paint_ex("10 Bold, Underline, Italic, 84, 124", .[.BOLD, .UNDERLINE, .ITALIC], 84, 124)); print("\n\n"); log("--- paint_ex_custom() -----------------------------"); My_Colors :: enum #specified { NONE :: -1; COL1 :: 95; COL2 :: 201; } log(paint_ex_custom("11 Underline, fg Custom, bg Custom", .UNDERLINE, My_Colors.COL1, My_Colors.COL2)); print("\n\n"); log("--- paint_rgb() -----------------------------"); log(paint_rgb("12 Underline, fg rgb(255,0,0), bg rgb(0,0,255)", .UNDERLINE, .{ 255, 0, 0 }, .{ 0, 0, 255 })); print("\n"); 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 })); print("\n\n"); log("--- paint_raw() -----------------------------"); log(paint_raw("1;3;32;45", "14 tbd tbd tbd", no_termination = false)); print("\n\n"); }