line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Convert::Color::HUSLp; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
732
|
use 5.008009; |
|
2
|
|
|
|
|
5
|
|
4
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
31
|
|
5
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
38
|
|
6
|
2
|
|
|
2
|
|
4
|
use parent qw/Convert::Color::HUSL/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
96
|
use Convert::Color::XYZ; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
39
|
|
9
|
2
|
|
|
2
|
|
5
|
use Convert::Color::LUV; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
26
|
|
10
|
2
|
|
|
2
|
|
5
|
use Convert::Color::LCh; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
57
|
|
11
|
2
|
|
|
2
|
|
9
|
use List::Util qw/min/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
106
|
|
12
|
2
|
|
|
2
|
|
7
|
use Math::Trig qw/:pi/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
187
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
BEGIN { |
15
|
2
|
|
|
2
|
|
290
|
*_get_bounds = *Convert::Color::HUSL::_get_bounds; ## no critic (ProtectPrivate) |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '1.000'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->register_color_space('huslp'); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _intersect_line_line { |
23
|
9180
|
|
|
9180
|
|
6239
|
my ($l1, $l2) = @_; |
24
|
9180
|
|
|
|
|
11445
|
($l1->[1] - $l2->[1]) / ($l2->[0] - $l1->[0]) |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _distance_from_pole { |
28
|
9180
|
|
|
9180
|
|
5935
|
my ($x, $y) = @_; |
29
|
9180
|
|
|
|
|
11734
|
sqrt $x * $x + $y * $y |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub max_chroma_for_lh { |
33
|
1530
|
|
|
1530
|
0
|
1223
|
my ($self, $l) = @_; |
34
|
|
|
|
|
|
|
min map { |
35
|
1530
|
|
|
|
|
4062
|
my ($m, $n) = @$_; |
|
9180
|
|
|
|
|
8069
|
|
36
|
9180
|
|
|
|
|
11106
|
my $x = _intersect_line_line $_, [-1 / $m, 0]; |
37
|
9180
|
|
|
|
|
10358
|
_distance_from_pole $x, $n + $x * $m |
38
|
|
|
|
|
|
|
} _get_bounds $l |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |