| Chart-Clicker documentation | Contained in the Chart-Clicker distribution. |
Chart::Clicker::Decoration::Glass - Under-chart gradient decoration
A glass-like decoration.
Set/Get the background color for this glass.
Set/Get the glare color for this glass.
Creates a new Chart::Clicker::Decoration::Glass object.
Draw this Glass.
Prepare this Glass for drawing
Cory G Watson <gphat@cpan.org>
perl(1)
You can redistribute and/or modify this code under the same terms as Perl itself.
| Chart-Clicker documentation | Contained in the Chart-Clicker distribution. |
package Chart::Clicker::Decoration::Glass; use Moose; extends 'Chart::Clicker::Decoration'; use Graphics::Color::RGB; use Graphics::Primitive::Operation::Fill; use Graphics::Primitive::Paint::Solid; has 'background_color' => ( is => 'rw', isa => 'Graphics::Color::RGB', default => sub { Graphics::Color::RGB->new(red => 1, green => 0, blue => 0, alpha => 1) }); has 'glare_color' => ( is => 'rw', isa => 'Graphics::Color::RGB', default => sub { Graphics::Color::RGB->new( red => 1, green => 1, blue => 1, alpha => 1 ) }, ); override('finalize', sub { my ($self) = @_; my $twentypofheight = $self->height * .20; $self->move_to(1, $twentypofheight); $self->rel_curve_to( 0, 0, $self->width / 2, $self->height * .30, $self->width, 0 ); $self->line_to($self->width, 0); $self->line_to(0, 0); $self->line_to(0, $twentypofheight); my $fillop = Graphics::Primitive::Operation::Fill->new( paint => Graphics::Primitive::Paint::Solid->new( color => $self->glare_color ) ); $self->do($fillop); }); __PACKAGE__->meta->make_immutable; no Moose; 1; __END__