use text color if we don't have custom one
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 10 Nov 2017 07:58:47 +0000 (08:58 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 10 Nov 2017 07:58:47 +0000 (08:58 +0100)
gpio.pl

diff --git a/gpio.pl b/gpio.pl
index e7a3056..f313942 100755 (executable)
--- a/gpio.pl
+++ b/gpio.pl
@@ -210,10 +210,10 @@ sub svg_style {
                return qq{ style="fill:$fg"};
        } elsif ( $name =~ m/\[(\w+)\d/ ) { # kernel
                my $dev = $1;
-               if ( my ($fg,$bg) = @{ $cols->{$dev} } ) {
-                       rect $x,$y,$col,$bg;
-                       return qq{ style="fill:$fg"};
-               }
+               my ($fg,$bg) = @{ $cols->{txt} };
+               ($fg,$bg) = @{ $cols->{$dev} } if exists $cols->{$dev};
+               rect $x,$y,$col,$bg;
+               return qq{ style="fill:$fg"};
        } else {
                my ( $fg, $bg ) = @{ $cols->{txt} };
                rect $x,$y,$col,$bg;