line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Convert::Color::HUSLp; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1031
|
use 5.008009; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
63
|
|
4
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
68
|
|
5
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
97
|
|
6
|
2
|
|
|
2
|
|
10
|
use parent qw/Convert::Color::HUSL/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
162
|
use Convert::Color::XYZ; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
33
|
|
9
|
2
|
|
|
2
|
|
7
|
use Convert::Color::LUV; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
36
|
|
10
|
2
|
|
|
2
|
|
6
|
use Convert::Color::LCh; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
40
|
|
11
|
2
|
|
|
2
|
|
8
|
use List::Util qw/min/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
105
|
|
12
|
2
|
|
|
2
|
|
8
|
use Math::Trig qw/:pi/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
211
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
BEGIN { |
15
|
2
|
|
|
2
|
|
389
|
*_get_bounds = *Convert::Color::HUSL::_get_bounds; ## no critic (ProtectPrivate) |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.002001'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->register_color_space('huslp'); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _intersect_line_line { |
23
|
9180
|
|
|
9180
|
|
7683
|
my ($l1, $l2) = @_; |
24
|
9180
|
|
|
|
|
14824
|
($l1->[1] - $l2->[1]) / ($l2->[0] - $l1->[0]) |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub _distance_from_pole { |
28
|
9180
|
|
|
9180
|
|
7416
|
my ($x, $y) = @_; |
29
|
9180
|
|
|
|
|
15043
|
sqrt $x * $x + $y * $y |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub max_chroma_for_lh { |
33
|
1530
|
|
|
1530
|
0
|
1495
|
my ($self, $l) = @_; |
34
|
9180
|
|
|
|
|
8055
|
min map { |
35
|
1530
|
|
|
|
|
2692
|
my ($m, $n) = @$_; |
36
|
9180
|
|
|
|
|
13325
|
my $x = _intersect_line_line $_, [-1 / $m, 0]; |
37
|
9180
|
|
|
|
|
13130
|
_distance_from_pole $x, $n + $x * $m |
38
|
|
|
|
|
|
|
} _get_bounds $l |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |