| 1 | #! perl | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 12 | ▶ | use v5.26; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 12 | ▶ | use Object::Pad; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 12 | ▶ | use utf8; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | class SVGPDF::Colour; | ||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 12 | field $colour :accessor :param = undef; | |||||||||||||||||||||||||||||||
| 10 | 0 | ▶ | field $red :accessor :param = undef; | ||||||||||||||||||||||||||||||
|
Subroutine
colour: not called CC=2 SCAR=14.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | field $green :accessor :param = undef; | ||||||||||||||||||||||||||||||
|
Subroutine
red: not called CC=2 SCAR=14.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | field $blue :accessor :param = undef; | ||||||||||||||||||||||||||||||
|
Subroutine
green: not called CC=2 SCAR=14.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 13 | 0 | ▶ | field $alpha :accessor :param = undef; | ||||||||||||||||||||||||||||||
|
Subroutine
blue: not called CC=2 SCAR=14.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | my @colours = qw( red green blue alpha ); | ||||||||||||||||||||||||||||||
|
Subroutine
alpha: not called CC=2 SCAR=11.6
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | 12 | ▶ | use constant GREY => 128; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | # The official 147 SVG coulr names. | ||||||||||||||||||||||||||||||||
| 20 | 12 | my %colours = | |||||||||||||||||||||||||||||||
| 21 | ( aliceblue => "#F0F8FF", | ||||||||||||||||||||||||||||||||
| 22 | antiquewhite => "#FAEBD7", | ||||||||||||||||||||||||||||||||
| 23 | aqua => "#00FFFF", | ||||||||||||||||||||||||||||||||
| 24 | aquamarine => "#7FFFD4", | ||||||||||||||||||||||||||||||||
| 25 | azure => "#F0FFFF", | ||||||||||||||||||||||||||||||||
| 26 | beige => "#F5F5DC", | ||||||||||||||||||||||||||||||||
| 27 | bisque => "#FFE4C4", | ||||||||||||||||||||||||||||||||
| 28 | black => "#000000", | ||||||||||||||||||||||||||||||||
| 29 | blanchedalmond => "#FFEBCD", | ||||||||||||||||||||||||||||||||
| 30 | blue => "#0000FF", | ||||||||||||||||||||||||||||||||
| 31 | blueviolet => "#8A2BE2", | ||||||||||||||||||||||||||||||||
| 32 | brown => "#A52A2A", | ||||||||||||||||||||||||||||||||
| 33 | burlywood => "#DEB887", | ||||||||||||||||||||||||||||||||
| 34 | cadetblue => "#5F9EA0", | ||||||||||||||||||||||||||||||||
| 35 | chartreuse => "#7FFF00", | ||||||||||||||||||||||||||||||||
| 36 | chocolate => "#D2691E", | ||||||||||||||||||||||||||||||||
| 37 | coral => "#FF7F50", | ||||||||||||||||||||||||||||||||
| 38 | cornflowerblue => "#6495ED", | ||||||||||||||||||||||||||||||||
| 39 | cornsilk => "#FFF8DC", | ||||||||||||||||||||||||||||||||
| 40 | crimson => "#DC143C", | ||||||||||||||||||||||||||||||||
| 41 | cyan => "#00FFFF", | ||||||||||||||||||||||||||||||||
| 42 | darkblue => "#00008B", | ||||||||||||||||||||||||||||||||
| 43 | darkcyan => "#008B8B", | ||||||||||||||||||||||||||||||||
| 44 | darkgoldenrod => "#B8860B", | ||||||||||||||||||||||||||||||||
| 45 | darkgray => "#A9A9A9", | ||||||||||||||||||||||||||||||||
| 46 | darkgreen => "#006400", | ||||||||||||||||||||||||||||||||
| 47 | darkgrey => "#A9A9A9", | ||||||||||||||||||||||||||||||||
| 48 | darkkhaki => "#BDB76B", | ||||||||||||||||||||||||||||||||
| 49 | darkmagenta => "#8B008B", | ||||||||||||||||||||||||||||||||
| 50 | darkolivegreen => "#556B2F", | ||||||||||||||||||||||||||||||||
| 51 | darkorange => "#FF8C00", | ||||||||||||||||||||||||||||||||
| 52 | darkorchid => "#9932CC", | ||||||||||||||||||||||||||||||||
| 53 | darkred => "#8B0000", | ||||||||||||||||||||||||||||||||
| 54 | darksalmon => "#E9967A", | ||||||||||||||||||||||||||||||||
| 55 | darkseagreen => "#8FBC8F", | ||||||||||||||||||||||||||||||||
| 56 | darkslateblue => "#483D8B", | ||||||||||||||||||||||||||||||||
| 57 | darkslategray => "#2F4F4F", | ||||||||||||||||||||||||||||||||
| 58 | darkslategrey => "#2F4F4F", | ||||||||||||||||||||||||||||||||
| 59 | darkturquoise => "#00CED1", | ||||||||||||||||||||||||||||||||
| 60 | darkviolet => "#9400D3", | ||||||||||||||||||||||||||||||||
| 61 | deeppink => "#FF1493", | ||||||||||||||||||||||||||||||||
| 62 | deepskyblue => "#00BFFF", | ||||||||||||||||||||||||||||||||
| 63 | dimgray => "#696969", | ||||||||||||||||||||||||||||||||
| 64 | dimgrey => "#696969", | ||||||||||||||||||||||||||||||||
| 65 | dodgerblue => "#1E90FF", | ||||||||||||||||||||||||||||||||
| 66 | firebrick => "#B22222", | ||||||||||||||||||||||||||||||||
| 67 | floralwhite => "#FFFAF0", | ||||||||||||||||||||||||||||||||
| 68 | forestgreen => "#228B22", | ||||||||||||||||||||||||||||||||
| 69 | fuchsia => "#FF00FF", | ||||||||||||||||||||||||||||||||
| 70 | gainsboro => "#DCDCDC", | ||||||||||||||||||||||||||||||||
| 71 | ghostwhite => "#F8F8FF", | ||||||||||||||||||||||||||||||||
| 72 | gold => "#FFD700", | ||||||||||||||||||||||||||||||||
| 73 | goldenrod => "#DAA520", | ||||||||||||||||||||||||||||||||
| 74 | gray => "#808080", | ||||||||||||||||||||||||||||||||
| 75 | green => "#008000", | ||||||||||||||||||||||||||||||||
| 76 | greenyellow => "#ADFF2F", | ||||||||||||||||||||||||||||||||
| 77 | grey => "#808080", | ||||||||||||||||||||||||||||||||
| 78 | honeydew => "#F0FFF0", | ||||||||||||||||||||||||||||||||
| 79 | hotpink => "#FF69B4", | ||||||||||||||||||||||||||||||||
| 80 | indianred => "#CD5C5C", | ||||||||||||||||||||||||||||||||
| 81 | indigo => "#4B0082", | ||||||||||||||||||||||||||||||||
| 82 | ivory => "#FFFFF0", | ||||||||||||||||||||||||||||||||
| 83 | khaki => "#F0E68C", | ||||||||||||||||||||||||||||||||
| 84 | lavender => "#E6E6FA", | ||||||||||||||||||||||||||||||||
| 85 | lavenderblush => "#FFF0F5", | ||||||||||||||||||||||||||||||||
| 86 | lawngreen => "#7CFC00", | ||||||||||||||||||||||||||||||||
| 87 | lemonchiffon => "#FFFACD", | ||||||||||||||||||||||||||||||||
| 88 | lightblue => "#ADD8E6", | ||||||||||||||||||||||||||||||||
| 89 | lightcoral => "#F08080", | ||||||||||||||||||||||||||||||||
| 90 | lightcyan => "#E0FFFF", | ||||||||||||||||||||||||||||||||
| 91 | lightgoldenrodyellow => "#FAFAD2", | ||||||||||||||||||||||||||||||||
| 92 | lightgray => "#D3D3D3", | ||||||||||||||||||||||||||||||||
| 93 | lightgreen => "#90EE90", | ||||||||||||||||||||||||||||||||
| 94 | lightgrey => "#D3D3D3", | ||||||||||||||||||||||||||||||||
| 95 | lightpink => "#FFB6C1", | ||||||||||||||||||||||||||||||||
| 96 | lightsalmon => "#FFA07A", | ||||||||||||||||||||||||||||||||
| 97 | lightseagreen => "#20B2AA", | ||||||||||||||||||||||||||||||||
| 98 | lightskyblue => "#87CEFA", | ||||||||||||||||||||||||||||||||
| 99 | lightslategray => "#778899", | ||||||||||||||||||||||||||||||||
| 100 | lightslategrey => "#778899", | ||||||||||||||||||||||||||||||||
| 101 | lightsteelblue => "#B0C4DE", | ||||||||||||||||||||||||||||||||
| 102 | lightyellow => "#FFFFE0", | ||||||||||||||||||||||||||||||||
| 103 | lime => "#00FF00", | ||||||||||||||||||||||||||||||||
| 104 | limegreen => "#32CD32", | ||||||||||||||||||||||||||||||||
| 105 | linen => "#FAF0E6", | ||||||||||||||||||||||||||||||||
| 106 | magenta => "#FF00FF", | ||||||||||||||||||||||||||||||||
| 107 | maroon => "#800000", | ||||||||||||||||||||||||||||||||
| 108 | mediumaquamarine => "#66CDAA", | ||||||||||||||||||||||||||||||||
| 109 | mediumblue => "#0000CD", | ||||||||||||||||||||||||||||||||
| 110 | mediumorchid => "#BA55D3", | ||||||||||||||||||||||||||||||||
| 111 | mediumpurple => "#9370DB", | ||||||||||||||||||||||||||||||||
| 112 | mediumseagreen => "#3CB371", | ||||||||||||||||||||||||||||||||
| 113 | mediumslateblue => "#7B68EE", | ||||||||||||||||||||||||||||||||
| 114 | mediumspringgreen => "#00FA9A", | ||||||||||||||||||||||||||||||||
| 115 | mediumturquoise => "#48D1CC", | ||||||||||||||||||||||||||||||||
| 116 | mediumvioletred => "#C71585", | ||||||||||||||||||||||||||||||||
| 117 | midnightblue => "#191970", | ||||||||||||||||||||||||||||||||
| 118 | mintcream => "#F5FFFA", | ||||||||||||||||||||||||||||||||
| 119 | mistyrose => "#FFE4E1", | ||||||||||||||||||||||||||||||||
| 120 | moccasin => "#FFE4B5", | ||||||||||||||||||||||||||||||||
| 121 | navajowhite => "#FFDEAD", | ||||||||||||||||||||||||||||||||
| 122 | navy => "#000080", | ||||||||||||||||||||||||||||||||
| 123 | oldlace => "#FDF5E6", | ||||||||||||||||||||||||||||||||
| 124 | olive => "#808000", | ||||||||||||||||||||||||||||||||
| 125 | olivedrab => "#6B8E23", | ||||||||||||||||||||||||||||||||
| 126 | orange => "#FFA500", | ||||||||||||||||||||||||||||||||
| 127 | orangered => "#FF4500", | ||||||||||||||||||||||||||||||||
| 128 | orchid => "#DA70D6", | ||||||||||||||||||||||||||||||||
| 129 | palegoldenrod => "#EEE8AA", | ||||||||||||||||||||||||||||||||
| 130 | palegreen => "#98FB98", | ||||||||||||||||||||||||||||||||
| 131 | paleturquoise => "#AFEEEE", | ||||||||||||||||||||||||||||||||
| 132 | palevioletred => "#DB7093", | ||||||||||||||||||||||||||||||||
| 133 | papayawhip => "#FFEFD5", | ||||||||||||||||||||||||||||||||
| 134 | peachpuff => "#FFDAB9", | ||||||||||||||||||||||||||||||||
| 135 | peru => "#CD853F", | ||||||||||||||||||||||||||||||||
| 136 | pink => "#FFC0CB", | ||||||||||||||||||||||||||||||||
| 137 | plum => "#DDA0DD", | ||||||||||||||||||||||||||||||||
| 138 | powderblue => "#B0E0E6", | ||||||||||||||||||||||||||||||||
| 139 | purple => "#800080", | ||||||||||||||||||||||||||||||||
| 140 | red => "#FF0000", | ||||||||||||||||||||||||||||||||
| 141 | rosybrown => "#BC8F8F", | ||||||||||||||||||||||||||||||||
| 142 | royalblue => "#4169E1", | ||||||||||||||||||||||||||||||||
| 143 | saddlebrown => "#8B4513", | ||||||||||||||||||||||||||||||||
| 144 | salmon => "#FA8072", | ||||||||||||||||||||||||||||||||
| 145 | sandybrown => "#F4A460", | ||||||||||||||||||||||||||||||||
| 146 | seagreen => "#2E8B57", | ||||||||||||||||||||||||||||||||
| 147 | seashell => "#FFF5EE", | ||||||||||||||||||||||||||||||||
| 148 | sienna => "#A0522D", | ||||||||||||||||||||||||||||||||
| 149 | silver => "#C0C0C0", | ||||||||||||||||||||||||||||||||
| 150 | skyblue => "#87CEEB", | ||||||||||||||||||||||||||||||||
| 151 | slateblue => "#6A5ACD", | ||||||||||||||||||||||||||||||||
| 152 | slategray => "#708090", | ||||||||||||||||||||||||||||||||
| 153 | slategrey => "#708090", | ||||||||||||||||||||||||||||||||
| 154 | snow => "#FFFAFA", | ||||||||||||||||||||||||||||||||
| 155 | springgreen => "#00FF7F", | ||||||||||||||||||||||||||||||||
| 156 | steelblue => "#4682B4", | ||||||||||||||||||||||||||||||||
| 157 | tan => "#D2B48C", | ||||||||||||||||||||||||||||||||
| 158 | teal => "#008080", | ||||||||||||||||||||||||||||||||
| 159 | thistle => "#D8BFD8", | ||||||||||||||||||||||||||||||||
| 160 | tomato => "#FF6347", | ||||||||||||||||||||||||||||||||
| 161 | turquoise => "#40E0D0", | ||||||||||||||||||||||||||||||||
| 162 | violet => "#EE82EE", | ||||||||||||||||||||||||||||||||
| 163 | wheat => "#F5DEB3", | ||||||||||||||||||||||||||||||||
| 164 | white => "#FFFFFF", | ||||||||||||||||||||||||||||||||
| 165 | whitesmoke => "#F5F5F5", | ||||||||||||||||||||||||||||||||
| 166 | yellow => "#FFFF00", | ||||||||||||||||||||||||||||||||
| 167 | yellowgreen => "#9ACD32", | ||||||||||||||||||||||||||||||||
| 168 | ); | ||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||
| 170 | 12 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||
| 172 | ADJUST { | ||||||||||||||||||||||||||||||||
| 173 | my ( $r, $g, $b, $a ); | ||||||||||||||||||||||||||||||||
| 174 | if ( defined $colour ) { | ||||||||||||||||||||||||||||||||
| 175 | ( $r, $g, $b, $a ) = $self->_parse($colour); | ||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||
| 177 | $red //= $r // 0; | ||||||||||||||||||||||||||||||||
| 178 | $green //= $g // 0; | ||||||||||||||||||||||||||||||||
| 179 | $blue //= $b // 0; | ||||||||||||||||||||||||||||||||
| 180 | $alpha //= $a // 0; | ||||||||||||||||||||||||||||||||
| 181 | $self->_check(); | ||||||||||||||||||||||||||||||||
| 182 | 12 | }; | |||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||
| 184 | 0 | ▶ | method _parse( $col ) { | ||||||||||||||||||||||||||||||
|
Subroutine
_parse: not called CC=15 SCAR=54.8
| |||||||||||||||||||||||||||||||||
| 185 | 0 | $col =~ s/\s+//g; | |||||||||||||||||||||||||||||||
| 186 | 0 | $col = lc($col); | |||||||||||||||||||||||||||||||
| 187 | 0 | my ( $r, $g, $b, $a ) = ( GREY, GREY, GREY, GREY ); | |||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | if ( $col =~ /^rgb\((.+?),(.+?),(.+?)\)$/ ) { | ||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||
| 189 | 0 | ( $r, $g, $b, $a ) = ( $1, $2, $3, 0 ); | |||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||
| 191 | elsif ( $col =~ /^rgba\((.+?),(.+?),(.+?),(.+?)\)$/ ) { | ||||||||||||||||||||||||||||||||
| 192 | 0 | ( $r, $g, $b, $a ) = ( $1, $2, $3, $4 ); | |||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||
| 194 | elsif ( $col =~ /^\#([a-f0-9]+)$/ ) { | ||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | if ( length($1) == 6 || length($1) == 8 ) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
length $1 == 6 or length $1 == 8
MC/DC0%0/2
length $1 == 6 or length $1 == 8
length $1 == 6
length $1 == 8
Truth table0%0/3
A or B
A= length $1 == 6B= length $1 == 8
| |||||||||||||||||||||||||||||||||
| 196 | # HEX: RRGGBB of RRGGBBAA. | ||||||||||||||||||||||||||||||||
| 197 | 0 | $r = hex(substr( $1, 0, 2 )); | |||||||||||||||||||||||||||||||
| 198 | 0 | $g = hex(substr( $1, 2, 2 )); | |||||||||||||||||||||||||||||||
| 199 | 0 | $b = hex(substr( $1, 4, 2 )); | |||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | $a = hex(substr( $1, 6, 2 )) if length($1) == 8; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||||||
| 202 | ▶ | elsif ( length($1) == 3 || length($1) == 4 ) { | |||||||||||||||||||||||||||||||
|
Condition0%0/3
length $1 == 3 or length $1 == 4
MC/DC0%0/2
length $1 == 3 or length $1 == 4
length $1 == 3
length $1 == 4
Truth table0%0/3
A or B
A= length $1 == 3B= length $1 == 4
| |||||||||||||||||||||||||||||||||
| 203 | # Shorthand HEX: RGB => RRGGBB. | ||||||||||||||||||||||||||||||||
| 204 | 0 | $r = hex(substr( $1, 0, 1 ).substr( $1, 0, 1 )); | |||||||||||||||||||||||||||||||
| 205 | 0 | $g = hex(substr( $1, 1, 1 ).substr( $1, 1, 1 )); | |||||||||||||||||||||||||||||||
| 206 | 0 | $b = hex(substr( $1, 2, 1 ).substr( $1, 2, 1 )); | |||||||||||||||||||||||||||||||
| 207 | 0 | ▶ | $a = hex(substr( $1, 3, 1 ).substr( $1, 3, 1 )) if length($1) == 4; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||
| 210 | elsif ( defined $colours{$col} ) { | ||||||||||||||||||||||||||||||||
| 211 | # Known. Parse HEX. | ||||||||||||||||||||||||||||||||
| 212 | 0 | return $self->_parse($colours{$col}); | |||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||
| 214 | elsif ( $col =~ /^url\(/ ) { | ||||||||||||||||||||||||||||||||
| 215 | 0 | return $self->_parse($colours{"grey"}); | |||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||
| 217 | else { | ||||||||||||||||||||||||||||||||
| 218 | 0 | carp("Illegal colour \"$col\""); | |||||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||||
| 220 | 0 | my $i = 0; | |||||||||||||||||||||||||||||||
| 221 | 0 | for ( $r, $g, $b, $a ) { | |||||||||||||||||||||||||||||||
| 222 | 0 | ▶ | if ( /^(\d+(?:\.\d+)?)\%$/ ) { # 98.27% | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 223 | 0 | $_ = $1 / 100 * 255; | |||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||
| 225 | elsif ( /^\d+$/ ) { # 124 | ||||||||||||||||||||||||||||||||
| 226 | # ok | ||||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||
| 228 | else { | ||||||||||||||||||||||||||||||||
| 229 | 0 | carp("Illegal colour value $colours[$i]: $_"); | |||||||||||||||||||||||||||||||
| 230 | 0 | $_ = GREY; | |||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||
| 232 | 0 | $i++; | |||||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||||||
| 234 | 0 | return ( $r, $g, $b, $a ); | |||||||||||||||||||||||||||||||
| 235 | 12 | } | |||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||
| 237 | 0 | ▶ | method _check() { | ||||||||||||||||||||||||||||||
|
Subroutine
_check: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||
| 238 | 0 | my $i = 0; | |||||||||||||||||||||||||||||||
| 239 | 0 | for ( $red, $green, $blue, $alpha ) { | |||||||||||||||||||||||||||||||
| 240 | 0 | ▶ | next if $_ >= 0 && $_ <= 255; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$_ >= 0 and $_ <= 255
MC/DC0%0/2
$_ >= 0 and $_ <= 255
$_ >= 0
$_ <= 255
Truth table0%0/3
A and B
A= $_ >= 0B= $_ <= 255
| |||||||||||||||||||||||||||||||||
| 241 | 0 | carp("Illegal colour value $colours[$i]: $_"); | |||||||||||||||||||||||||||||||
| 242 | 0 | $_ = GREY, | |||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||
| 244 | 12 | } | |||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||
| 246 | 0 | ▶ | method parse( $col = $colour ) { | ||||||||||||||||||||||||||||||
|
Subroutine
parse: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 247 | 0 | ( $red, $green, $blue, $alpha ) = _parse($col); | |||||||||||||||||||||||||||||||
| 248 | 0 | $self->_check; | |||||||||||||||||||||||||||||||
| 249 | 12 | } | |||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | method rgb() { | ||||||||||||||||||||||||||||||
|
Subroutine
rgb: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 252 | 0 | sprintf( "#%02X%02X%02X", $red, $green, $blue ); | |||||||||||||||||||||||||||||||
| 253 | 12 | } | |||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||
| 255 | 0 | ▶ | method rgba() { | ||||||||||||||||||||||||||||||
|
Subroutine
rgba: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 256 | 0 | sprintf( "#%02X%02X%02X%02X", $red, $green, $blue, $alpha ); | |||||||||||||||||||||||||||||||
| 257 | 12 | } | |||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||
| 259 | 12 | 1; | |||||||||||||||||||||||||||||||