Clicker/Decoration/Glass.pm

filter: Statementstmt 72.7% 24 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod n/a totaltotal 75.6% 31 / 41 CC 1 SCAR 1.2
CC
1
Cov
73%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Clicker/Drawing/ColorAllocator.pm ↑ Summary Clicker/Context.pm »
1 package Chart::Clicker::Decoration::Glass;
2 1 $Chart::Clicker::Decoration::Glass::VERSION = '2.89';
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 extends 'Chart::Clicker::Decoration';
6  
7 # ABSTRACT: Under-chart gradient decoration
8  
9 1 ▶use Graphics::Color::RGB;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Graphics::Primitive::Operation::Fill;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Graphics::Primitive::Paint::Solid;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 has 'background_color' => (
15 is => 'rw',
16 isa => 'Graphics::Color::RGB',
17 default => sub {
18 1 ▶ Graphics::Color::RGB->new(
Subroutine __ANON__: called CC=1 SCAR=0.0
19 red => 1, green => 0, blue => 0, alpha => 1
20 )
21 }
22 1 );
23  
24  
25 has 'glare_color' => (
26 is => 'rw',
27 isa => 'Graphics::Color::RGB',
28 default => sub {
29 1 ▶ Graphics::Color::RGB->new(
Subroutine __ANON__: called CC=1 SCAR=0.0
30 red => 1, green => 1, blue => 1, alpha => 1
31 )
32 },
33 1 );
34  
35 override('finalize', sub {
36 0 ▶ my ($self) = @_;
Subroutine __ANON__: not called CC=1 SCAR=6.9
37  
38 0 my $twentypofheight = $self->height * .20;
39  
40 0 $self->move_to(1, $twentypofheight);
41  
42 0 $self->rel_curve_to(
43 0, 0,
44 $self->width / 2, $self->height * .30,
45 $self->width, 0
46 );
47  
48 0 $self->line_to($self->width, 0);
49 0 $self->line_to(0, 0);
50 0 $self->line_to(0, $twentypofheight);
51  
52 0 my $fillop = Graphics::Primitive::Operation::Fill->new(
53 paint => Graphics::Primitive::Paint::Solid->new(
54 color => $self->glare_color
55 )
56 );
57 0 $self->do($fillop);
58 1 });
59  
60 1 __PACKAGE__->meta->make_immutable;
61  
62 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
63  
64 1 1;
65  
66 __END__
67  
68 =pod
69  
70 =head1 NAME
71  
72 Chart::Clicker::Decoration::Glass - Under-chart gradient decoration
73  
74 =head1 VERSION
75  
76 version 2.89
77  
78 =head1 DESCRIPTION
79  
80 A glass-like decoration.
81  
82 =head1 ATTRIBUTES
83  
84 =head2 background_color
85  
86 Set/Get the background L<color|Graphics::Color::RGB> for this glass.
87  
88 =head2 glare_color
89  
90 Set/Get the glare L<color|Graphics::Color::RGB> for this glass.
91  
92 =head1 AUTHOR
93  
94 Cory G Watson <gphat@cpan.org>
95  
96 =head1 COPYRIGHT AND LICENSE
97  
98 This software is copyright (c) 2016 by Cory G Watson.
99  
100 This is free software; you can redistribute it and/or modify it under
101 the same terms as the Perl 5 programming language system itself.
102  
103 =cut
« Clicker/Drawing/ColorAllocator.pm ↑ Summary Clicker/Context.pm »