line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Colour; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use Template::Colour::Class |
4
|
1
|
|
|
|
|
10
|
debug => 0, |
5
|
|
|
|
|
|
|
base => 'Template::Plugin Template::Colour', |
6
|
1
|
|
|
1
|
|
76600
|
constants => 'HASH'; |
|
1
|
|
|
|
|
4
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 2.10; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
23
|
|
|
23
|
1
|
123268
|
my ($class, $context, @args) = @_;; |
13
|
23
|
100
|
100
|
|
|
206
|
my $params = (@args && ref $args[-1] eq HASH) ? $args[-1] : { }; |
14
|
23
|
|
|
|
|
43
|
my $space; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# first argument can be 'rgb' or 'hsv' to indicate argument(s) type |
17
|
23
|
100
|
66
|
|
|
292
|
if ($space = $params->{ rgb } || $params->{ RGB }) { |
|
|
100
|
66
|
|
|
|
|
18
|
2
|
|
|
|
|
18
|
return $class->RGB($space); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
elsif ($space = $params->{ hsv } || $params->{ HSV }) { |
21
|
2
|
|
|
|
|
33
|
return $class->HSV($space); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
else { |
24
|
|
|
|
|
|
|
# RGB by default |
25
|
19
|
|
|
|
|
120
|
return $class->RGB(@args); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |