4 ms·
Similar concept: I like to be able to generate terminals of varying-but-viewable color schemes. I'd like to tweak this to use more an HSV than RGB scheme. #!
by dredmorbius 15y ago
Similar concept: I like to be able to generate terminals of varying-but-viewable color schemes. I'd like to tweak this to use more an HSV than RGB scheme.
#!/usr/bin/gawk -f
function ranint (x) { return int(rand() * x) }
function hex (x) { return sprintf("%02x", x) }
BEGIN {
mc = 96 # max color
# Seed RNG using nanoseconds
cmd="date +%N"
cmd | getline seed
close(cmd)
srand(seed)
r = ranint(mc)
g = ranint(mc)
b = ranint(mc)
printf( "rxvt -bg \x27#%s%s%s\x27 -fg gold -cr blue &\n", hex(r), hex(g), hex(b) )
}