« blib/lib/Graphics/Primitive/Paint.pm
↑ Summary
blib/lib/Graphics/Primitive/Paint/Gradient/Linear.pm »
| 1 | package Graphics::Primitive::Paint::Gradient; | ||
| 2 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use Moose::Util::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use MooseX::Storage; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | extends 'Graphics::Primitive::Paint'; | |
| 7 | |||
| 8 | # FIXME key should be <= 1 | ||
| 9 | has color_stops => ( | ||
| 10 | traits => ['Hash'], | ||
| 11 | isa => 'HashRef', | ||
| 12 | is => 'rw', | ||
| 13 | 2 | ▶ | default => sub { {} }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 14 | 1 | handles => { | |
| 15 | stop_count => 'count', | ||
| 16 | stops => 'keys', | ||
| 17 | get_stop => 'get', | ||
| 18 | add_stop => 'set', | ||
| 19 | } | ||
| 20 | ); | ||
| 21 | |||
| 22 | 1 | __PACKAGE__->meta->make_immutable; | |
| 23 | |||
| 24 | 1 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | 1 | 1; | |
| 26 | __END__ | ||
| 27 | =head1 NAME | ||
| 28 | |||
| 29 | Graphics::Primitive::Paint::Gradient - Color blending | ||
| 30 | |||
| 31 | =head1 DESCRIPTION | ||
| 32 | |||
| 33 | Graphics::Primitive::Paint::Gradient is a base class used by color blending | ||
| 34 | techniques such as linear and radial. You should not use this class directly. | ||
| 35 | |||
| 36 | =head1 METHODS | ||
| 37 | |||
| 38 | =head2 Constructor | ||
| 39 | |||
| 40 | =over 4 | ||
| 41 | |||
| 42 | =item I<new> | ||
| 43 | |||
| 44 | Creates a new Graphics::Primitive::Gradient | ||
| 45 | |||
| 46 | =back | ||
| 47 | |||
| 48 | =head2 Instance Methods | ||
| 49 | |||
| 50 | =over 4 | ||
| 51 | |||
| 52 | =item I<add_stop> | ||
| 53 | |||
| 54 | Adds a color stop at the specified position | ||
| 55 | |||
| 56 | =item I<colors> | ||
| 57 | |||
| 58 | Hashref of colors and their stops. The stops are the keys. | ||
| 59 | |||
| 60 | =item I<stop_count> | ||
| 61 | |||
| 62 | Count of stops added to this Gradient. | ||
| 63 | |||
| 64 | =item I<stops> | ||
| 65 | |||
| 66 | Get the keys of all color stops. | ||
| 67 | |||
| 68 | =back | ||
| 69 | |||
| 70 | =head1 AUTHOR | ||
| 71 | |||
| 72 | Cory Watson <gphat@cpan.org> | ||
| 73 | |||
| 74 | =head1 COPYRIGHT & LICENSE | ||
| 75 | |||
| 76 | Copyright 2008-2010 by Cory G Watson. | ||
| 77 | |||
| 78 | You can redistribute and/or modify this code under the same terms as Perl | ||
| 79 | itself. | ||