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   2357 use strict;
  10         16  
  10         276  
3 10     10   216 use 5.006;
  10         32  
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 44 my ($class, $name) = @_;
23              
24 18 100       79 exists $colors{lc $name} or return;
25              
26 12         59 return @{$colors{lc $name}};
  12         64  
27             }
28              
29             1;
30              
31             __DATA__