Use the first matched color instead of the last one, which is what

Wireshark does.

svn path=/trunk/; revision=43391
This commit is contained in:
Gerald Combs 2012-06-19 23:01:21 +00:00
parent e466eb2a3f
commit 75c8dbff83
1 changed files with 4 additions and 1 deletions

View File

@ -16,15 +16,18 @@ function set_node_color(node,colorname)
var bg;
EOF
my $elseflow = "";
while(<>)
{
if(/\@(.+?)\@.+\[(\d+),(\d+),(\d+)\]\[(\d+),(\d+),(\d+)\]/)
{
print " if(colorname == '$1') {\n";
print " " . $elseflow . "if (colorname == '$1') {\n";
printf(" bg='#%02x%02x%02x';\n", $2/256, $3/256, $4/256);
printf(" fg='#%02x%02x%02x';\n", $5/256, $6/256, $7/256);
print " }\n";
}
$elseflow = "else ";
}
print<<'EOF';