const encoder = new TextEncoder(); function csi(text, ... args) { const filt = args.filter(xx => xx !== null); const output = "\x1b[" + filt.join(";") + "m" + text; Deno.stdout.writeSync(encoder.encode(output)); } csi("True Color RGB:\n"); for (let ii = 0; ii<32; ++ii) { for (let jj = 0; jj<64; ++jj) { const fg_rr = jj*4; const fg_bb = ii*8; const fg_gg = (fg_rr + 3*fg_bb)>>2; const bg_rr = 255 - ii*8; const bg_gg = 127; const bg_bb = 255 - jj*4; csi("+", 38, 2, fg_rr, fg_gg, fg_bb, 48, 2, bg_rr, bg_gg, bg_bb, ); } csi("\n"); }