#!/usr/bin/env raku

use Terminal::ANSI::OO 't';

put t.save-screen;
put t.clear-screen;
put t.home;

put t.set-fg-rgb-color(255,0,0) ~ 'red';
put t.set-fg-rgb-color(0,255,0) ~ 'green';
put t.set-fg-rgb-color(0,0,255) ~ 'blue';
print t.set-fg-rgb-color($_,0,0) ~ "$_" for 0..255;
print t.set-fg-rgb-color(0,$_,0) ~ "$_" for 0..255;
print t.set-fg-rgb-color(0,0,$_) ~ "$_" for 0..255;
put "";
put t.white ~ 'bg';
print t.set-bg-rgb-color($_,0,0) ~ "$_" for 0..255;
print t.set-bg-rgb-color($_,$_ * 2 % 255,$_ * 3 % 255) ~ "$_" for 0..255;

put t.red ~ 'red';
put t.green ~ 'green';
put t.bright-blue ~ 'bright blue';
put t.bg-yellow ~ t.blue ~ 'blue on yellow';
put t.color(100) ~ t.bg-color(150) ~ '100 on 150';

put t.text-reset;

prompt "press return>";

put t.restore-screen;
