mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
98_DOIF.pm: color function: lightness difference
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@24399 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cd470a6c98
commit
42b919fb4e
@ -5124,14 +5124,17 @@ sub color {
|
|||||||
return ($hue);
|
return ($hue);
|
||||||
}
|
}
|
||||||
my $l;
|
my $l;
|
||||||
|
my $diff;
|
||||||
if (defined $lightness and $lightness ne "") {
|
if (defined $lightness and $lightness ne "") {
|
||||||
$l=$lightness;
|
$diff=$lightness-50;
|
||||||
} else {
|
} else {
|
||||||
if ($hue>180 and $hue<290) {
|
$diff=0;
|
||||||
$l=70;
|
|
||||||
} else {
|
|
||||||
$l=50;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($hue>180 and $hue<290) {
|
||||||
|
$l=70+$diff;
|
||||||
|
} else {
|
||||||
|
$l=50+$diff;
|
||||||
}
|
}
|
||||||
return ("hsl($hue,100%,".$l."%)");
|
return ("hsl($hue,100%,".$l."%)");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user