The smoke "colors" are always shades of grey. The number of shades I equal to the number of pings. the colors are set in the method smokecol(). Smokecol(0 is called with one argument the number of shades. Ths method is shown below:
Code Block |
---|
sub smokecol ($) { my $count = shift; return [] unless $count > 2; my $half = $count/2; my @items; for (my $i=$count; $i > $half; $i--){ my $color = int(190/$half * ($i-$half))+50; push @items, "AREA:cp".($i)."#".(sprintf("%02x",$color) x 3); }; for (my $i=int($half); $i > 0; $i--){ my $color = int(190/$half * ($half - $i + 1))+64; push @items, "AREA:cp".($i)."#".(sprintf("%02x",$color) x 3); }; return \@items; } |
The output appears as:
Code Block |
---|
COUNT: 10, HALF: 5 10: 240 9: 202 8: 164 7: 126 6: 88 HALF: 5 5: 102 4: 140 3: 178 2: 216 1: 254 AREA:cp10#f0f0f0 AREA:cp9#cacaca AREA:cp8#a4a4a4 AREA:cp7#7e7e7e AREA:cp6#585858 AREA:cp5#666666 AREA:cp4#8c8c8c AREA:cp3#b2b2b2 AREA:cp2#d8d8d8 AREA:cp1#fefefe |
An example of the colors/shades is shown below: