Chart::Clicker::Drawing::ColorAllocator
Allocates colors for use in the chart. The position in the color allocator corresponds to the series that will be colored.
use Graphics::Color::RGB; use Chart::Clicker::Drawing::ColorAllocator; my $ca = Chart::Clicker::Drawing::ColorAllocator->new({ colors => ( Graphics::Color::RGB->new( red => 1.0, green => 0, blue => 0, alpha => 1.0 ), ... ) }); my $red = $ca->get(0);
Create a new ColorAllocator. You can optionally pass an arrayref of colors to 'seed' the allocator.
Add a color to this allocator.
Clear this allocator's colors
Get the number of colors in this allocator.
Gets the color at the specified index. Returns undef if that position has no color.
Gets the current position.
Returns the next color. Each call to next increments the position, so subsequent calls will return different colors.
Resets this allocator back to the beginning.
Cory 'G' Watson <gphat@cpan.org>
perl(1)
You can redistribute and/or modify this code under the same terms as Perl itself.
To install Chart::Clicker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Chart::Clicker
CPAN shell
perl -MCPAN -e shell install Chart::Clicker
For more information on module installation, please visit the detailed CPAN module installation guide.