mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 23:06:37 +00:00
code cleanup (betateilchen), perl specials for rgb
git-svn-id: https://svn.fhem.de/fhem/trunk@3587 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cd3abaf84b
commit
3167ddf2e1
@ -323,7 +323,8 @@ RSS_evalLayout($$@) {
|
|||||||
my ($cmd, $def)= split("[ \t]+", $line, 2);
|
my ($cmd, $def)= split("[ \t]+", $line, 2);
|
||||||
#Log 5, "CMD= \"$cmd\", DEF= \"$def\"";
|
#Log 5, "CMD= \"$cmd\", DEF= \"$def\"";
|
||||||
if($cmd eq "rgb") {
|
if($cmd eq "rgb") {
|
||||||
$params{rgb}= $def;
|
$def= "\"$def\"" if(length($def) == 6 && $def =~ /[[:xdigit:]]{6}/);
|
||||||
|
$params{rgb}= AnalyzePerlCommand(undef, $def);
|
||||||
} elsif($cmd eq "font") {
|
} elsif($cmd eq "font") {
|
||||||
$params{font}= $def;
|
$params{font}= $def;
|
||||||
} elsif($cmd eq "pt") {
|
} elsif($cmd eq "pt") {
|
||||||
@ -379,8 +380,9 @@ RSS_returnJPEG($) {
|
|||||||
# create the image
|
# create the image
|
||||||
#
|
#
|
||||||
my $S;
|
my $S;
|
||||||
# my $S= GD::Image->newTrueColor($width,$height);
|
# let's create a blank image, we will need it in most cases.
|
||||||
# $S->colorAllocate(0,0,0); # black is the background
|
$S= GD::Image->newTrueColor($width,$height);
|
||||||
|
$S->colorAllocate(0,0,0); # black is the background
|
||||||
|
|
||||||
# wrap to make problems with GD non-lethal
|
# wrap to make problems with GD non-lethal
|
||||||
|
|
||||||
@ -431,25 +433,15 @@ RSS_returnJPEG($) {
|
|||||||
$h= $height;
|
$h= $height;
|
||||||
$w= $bgwidth/$v;
|
$w= $bgwidth/$v;
|
||||||
}
|
}
|
||||||
# create empty image
|
|
||||||
$S= GD::Image->newTrueColor($width,$height);
|
|
||||||
$S->colorAllocate(0,0,0); # black is the background
|
|
||||||
$S->copyResized($bg,($width-$w)/2,($height-$h)/2,0,0,$w,$h,$bgwidth,$bgheight);
|
$S->copyResized($bg,($width-$w)/2,($height-$h)/2,0,0,$w,$h,$bgwidth,$bgheight);
|
||||||
} else {
|
} else {
|
||||||
# size is as required, we take the original
|
# size is as required
|
||||||
|
# kill the predefined image and take the original
|
||||||
|
$S = undef;
|
||||||
$S= $bg;
|
$S= $bg;
|
||||||
}
|
}
|
||||||
} else {# # no background, we create an empty background
|
|
||||||
$S= GD::Image->newTrueColor($width,$height);
|
|
||||||
$S->colorAllocate(0,0,0); # black is the background
|
|
||||||
}
|
}
|
||||||
} else { # not opendir(BGDIR)
|
|
||||||
$S= GD::Image->newTrueColor($width,$height);
|
|
||||||
$S->colorAllocate(0,0,0); # black is the background
|
|
||||||
}
|
}
|
||||||
} else { # not defined $bgdir
|
|
||||||
$S= GD::Image->newTrueColor($width,$height);
|
|
||||||
$S->colorAllocate(0,0,0); # black is the background
|
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
# evaluate layout
|
# evaluate layout
|
||||||
@ -622,7 +614,8 @@ RSS_CGI(){
|
|||||||
|
|
||||||
<li>rgb <color><br>Sets the color. <color> is a 6-digit hex number, every 2 digits
|
<li>rgb <color><br>Sets the color. <color> is a 6-digit hex number, every 2 digits
|
||||||
determining the red, green and blue color components as in HTML color codes (e.g.
|
determining the red, green and blue color components as in HTML color codes (e.g.
|
||||||
<code>FF0000</code> for red, <code>C0C0C0</code> for light gray).</li><br>
|
<code>FF0000</code> for red, <code>C0C0C0</code> for light gray). You can use
|
||||||
|
<code>{ <a href="#perl"><perl special></a> }</code> for <color>.</li><br>
|
||||||
|
|
||||||
<li>pt <pt><br>Sets the font size in points.</li><br>
|
<li>pt <pt><br>Sets the font size in points.</li><br>
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user