summaryrefslogtreecommitdiff
path: root/tools/colorfilters2js.pl
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-06-19 23:01:21 +0000
committerGerald Combs <gerald@wireshark.org>2012-06-19 23:01:21 +0000
commit75c8dbff83f49260883e7a5b4c74e751da9aa1f7 (patch)
tree0d5c9fc4b43d81a4d58f10a2bb7707081935e8fb /tools/colorfilters2js.pl
parente466eb2a3f69715e62ccfa051f23d6a432b94315 (diff)
downloadwireshark-75c8dbff83f49260883e7a5b4c74e751da9aa1f7.tar.gz
Use the first matched color instead of the last one, which is what
Wireshark does. svn path=/trunk/; revision=43391
Diffstat (limited to 'tools/colorfilters2js.pl')
-rwxr-xr-xtools/colorfilters2js.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/colorfilters2js.pl b/tools/colorfilters2js.pl
index 03f09025a3..5e6548c6bb 100755
--- a/tools/colorfilters2js.pl
+++ b/tools/colorfilters2js.pl
@@ -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';