| 1 | package Imager::Color::Table; | ||||||||||||||||||||||||||||
| 2 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 11 | ▶ | use 5.006; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 11 | our $VERSION = "1.004"; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 11 | my %colors; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | { | ||||||||||||||||||||||||||||
| 10 | 11 | local $_; | |||||||||||||||||||||||||||
| 11 | 11 | ▶ | while (<DATA>) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | 9031 | ▶ | next if /^#/ or !/\S/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
/^#/ or not /\S/
MC/DC100%2/2
/^#/ or not /\S/
/^#/
not /\S/
Truth table100%3/3
A or not(B)
A= /^#/B= not /\S/
| |||||||||||||||||||||||||||||
| 13 | 8514 | chomp; | |||||||||||||||||||||||||||
| 14 | 8514 | my ($r, $g, $b, $name) = split ' ', $_, 4; | |||||||||||||||||||||||||||
| 15 | 8514 | ▶ | if ($name) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | 8382 | $colors{lc $name} = [ $r, $g, $b ]; | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 18 | ▶ | sub get { | ||||||||||||||||||||||||||
|
Subroutine
get: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 18 | my ($class, $name) = @_; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 18 | ▶ | exists $colors{lc $name} or return; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 12 | return @{$colors{lc $name}}; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 11 | 1; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | __DATA__ | ||||||||||||||||||||||||||||