mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-01 01:09:47 +00:00
FRM_RGB: remove a die from Color.pm
git-svn-id: https://svn.fhem.de/fhem/trunk@4175 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
869d443767
commit
f0b0655336
@ -154,6 +154,7 @@ FRM_RGB_Set($@)
|
||||
my $arg = $a[0];
|
||||
my $numPins = scalar(@{$hash->{PINS}});
|
||||
my $nybles = $numPins << 1;
|
||||
die "$arg is not the right format" unless( $arg =~ /^[\da-f]{$nybles}$/i );
|
||||
my @channels = RgbToChannels($arg,$numPins);
|
||||
FRM_RGB_SetChannels($hash,@channels);
|
||||
RGBHANDLER: {
|
||||
|
@ -63,8 +63,6 @@ Exporter::export_tags('all');
|
||||
sub
|
||||
RgbToChannels($$) {
|
||||
my ($rgb,$numChannels) = @_;
|
||||
my $nybles = $numChannels << 1;
|
||||
die "$rgb is not the right format" unless( $rgb =~ /^[\da-f]{$nybles}$/i );
|
||||
my @channels = ();
|
||||
foreach my $channel (unpack("(A2)[$numChannels]",$rgb)) {
|
||||
push @channels,hex($channel);
|
||||
|
Loading…
Reference in New Issue
Block a user