diff options
author | Gerald Combs <gerald@wireshark.org> | 2012-06-19 23:01:21 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2012-06-19 23:01:21 +0000 |
commit | 75c8dbff83f49260883e7a5b4c74e751da9aa1f7 (patch) | |
tree | 0d5c9fc4b43d81a4d58f10a2bb7707081935e8fb /tools/colorfilters2js.pl | |
parent | e466eb2a3f69715e62ccfa051f23d6a432b94315 (diff) | |
download | wireshark-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-x | tools/colorfilters2js.pl | 5 |
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'; |