From 98fe56e35917ca3f715a44762aebc83e8af8a787 Mon Sep 17 00:00:00 2001 From: betateilchen Date: Tue, 3 Feb 2015 14:56:17 +0000 Subject: [PATCH] contrib/Infopanel: added btIP_changeColor() git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7845 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/InfoPanel/55_InfoPanel.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fhem/contrib/InfoPanel/55_InfoPanel.pm b/fhem/contrib/InfoPanel/55_InfoPanel.pm index 2ac191bdd..6c8ae61c4 100644 --- a/fhem/contrib/InfoPanel/55_InfoPanel.pm +++ b/fhem/contrib/InfoPanel/55_InfoPanel.pm @@ -81,7 +81,7 @@ sub InfoPanel_Initialize($) { $hash->{DefFn} = "btIP_Define"; $hash->{UndefFn} = "btIP_Undef"; #$hash->{AttrFn} = "btIP_Attr"; - $hash->{AttrList} = "disable:0,1,toggle autoreload:1,0 bg bgcolor refresh size title tmin"; + $hash->{AttrList} = "disable:0,1 autoreload:1,0 bg bgcolor refresh size title tmin"; $hash->{SetFn} = "btIP_Set"; $hash->{NotifyFn} = "btIP_Notify"; @@ -541,6 +541,17 @@ sub btIP_xy { return($x,$y); } +sub btIP_changeColor { + my($file,$oldcolor,$newcolor) = @_; + my ($data,$readBytes); + my $length = -s "$file"; + open(GRAFIK, "<", $file) or die("File not found $!"); + binmode(GRAFIK); + $readBytes = read(GRAFIK, $data, $length); + close(GRAFIK); + $data =~ s/#$oldcolor/#$newcolor/g; + return $data; +} ################## #