.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Chart::Clicker::Drawing::ColorAllocator 3pm" .TH Chart::Clicker::Drawing::ColorAllocator 3pm "2016-12-28" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Chart::Clicker::Drawing::ColorAllocator \- Color picker .SH "VERSION" .IX Header "VERSION" version 2.90 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& 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); \& \& #or let Chart::Clicker autmatically pick complementing colors for you \& my $ca2 = Chart::Clicker::Drawing::ColorAllocator\->new({ \& seed_hue => 0, #red \& }); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Allocates colors for use in the chart. The position in the color allocator corresponds to the series that will be colored. .SH "AUTOMATIC COLOR ALLOCATION" .IX Header "AUTOMATIC COLOR ALLOCATION" This module has the capacity to automatically allocate 96 individual colors using Color::Scheme. It does so by picking 4 hues equally spaced in the color wheel from the \f(CW\*(C`seed_hue\*(C'\fR (0 (red) would be complimented by 270 (blue), 180 (green) and 90 (yellow)). After those colors are allocated it moves on to picking from the colors between those ( 45, 135, 215, 305 ) etc. Once all values of \f(CW\*(C`hues\*(C'\fR have been utilized, it repeats them using a different shade. This has the effect of generating evenly spaced complementing colors to ensure colors are well ditinguishable from one another and have appropriate contrast. .SS "position" .IX Subsection "position" Gets the current position. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "colors" .IX Subsection "colors" An arrayref of colors that will be used for series that Clicker draws. .SS "color_scheme" .IX Subsection "color_scheme" A lazy-building Color::Scheme object used to generate the color scheme of the chart; .SS "seed_hue" .IX Subsection "seed_hue" The interger value of the first hue used when computing the tetrade color scheme. Setting this will affect the hue of the first color allocated. Subsequent colors will be allocated based on their distance from this color to maintain sifficient contrast between colors. If not specified the seed_hue will default to 270, blue. .SS "hues" .IX Subsection "hues" An array reference of evenly spaced seed hues for color allocation. By default it will use the seed hue plus 0, 45, 75, 15, 60 and 30 which is enough to cover all web-safe colors when using a tetrade color scheme. .SS "shade_order" .IX Subsection "shade_order" An array reference of the order in which the different shades of each color will be used for every color scheme generated. It defaults to 1, 3, 0, 2 for optimum color spacing. .SH "METHODS" .IX Header "METHODS" .SS "add_to_colors" .IX Subsection "add_to_colors" Add a color to this allocator. .SS "clear_colors" .IX Subsection "clear_colors" Clear this allocator's colors .SS "color_count" .IX Subsection "color_count" Get the number of colors in this allocator. .SS "get_color ($index)" .IX Subsection "get_color ($index)" Gets the color at the specified index. Returns undef if that position has no color. .SS "next" .IX Subsection "next" Returns the next color. Each call to next increments the position, so subsequent calls will return different colors. .SS "allocate_color" .IX Subsection "allocate_color" Determines what the next color should be. .SS "reset" .IX Subsection "reset" Resets this allocator back to the beginning. .SH "AUTHOR" .IX Header "AUTHOR" Cory G Watson .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2016 by Cory G Watson. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.