Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'zeorge finally :) a super script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
zeorge finally :) a super script
Authored by: raider on Oct 29, '04 10:00:16AM
I combined Slur's and Zorge's scripts. I wanted the randomness of Slur's, but the speed of Zeorge's. Here is what I came up with:

#!/usr/bin/perl
$r = int(rand(2000));
$g = int(rand(2000));
$b = int(rand(2000));
$opaqueness = "0.98";
@text_colors = split " ",`defaults read com.apple.terminal TextColors`;
$pos = 1 ;
@text_colors[$pos*3] = ".$r";
@text_colors[$pos*3+1] = ".$g";
@text_colors[$pos*3+2] = ".$b";
$pos = 4 ;
@text_colors[$pos*3] = ".$r";
@text_colors[$pos*3+1] = ".$g";
@text_colors[$pos*3+2] = ".$b";
system("defaults","write","com.apple.terminal","TextColors","@text_colors");
system("defaults","write","com.apple.terminal","TerminalOpaqueness","$opaqueness");


Works pretty good, but every now and then I get a pretty bac random color... ;) Anyone who can improve the random generation ranges feel free to chime in....

[ Reply to This | # ]