File Coverage

blib/lib/Imager/Color/Table.pm
Criterion Covered Total %
statement 9 9 100.0
branch 2 2 100.0
condition n/a
subroutine 3 3 100.0
pod 1 1 100.0
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Imager::Color::Table;
2 10     10   2300 use strict;
  10         19  
  10         278  
3 10     10   226 use 5.006;
  10         31  
4              
5             our $VERSION = "1.004";
6              
7             my %colors;
8              
9             {
10             local $_;
11             while () {
12             next if /^#/ or !/\S/;
13             chomp;
14             my ($r, $g, $b, $name) = split ' ', $_, 4;
15             if ($name) {
16             $colors{lc $name} = [ $r, $g, $b ];
17             }
18             }
19             }
20              
21             sub get {
22 18     18 1 45 my ($class, $name) = @_;
23              
24 18 100       90 exists $colors{lc $name} or return;
25              
26 12         80 return @{$colors{lc $name}};
  12         68  
27             }
28              
29             1;
30              
31             __DATA__