NAME
Colour - Colour manipulation routines for use with GD::Graph
SYNOPSIS
use GD::Graph::colour qw( :colours :lists :files );
DESCRIPTION
The Colour Package provides a few routines to convert some colour names to RGB values. Also included are some functions to calculate the hue and luminance of the colours, mainly to be able to sort them.
The :colours tags can be used to import the _rgb, _hue, and _luminance functions, the :lists tag for colour_list and sorted_colour_list, and the :files tag exports the read_rgb function.
FUNCTIONS
- Colour::colour_list( number of colours )
-
Returns a list of number of colours colour names known to the package.
- Colour::sorted_colour_list( number of colours )
-
Returns a list of number of colours colour names known to the package, sorted by luminance or hue. NB. Right now it always sorts by luminance. Will add an option in a later stage to decide sorting method at run time.
- Colour::_rgb( colour name )
-
Returns a list of the RGB values of colour name.
- Colour::_hue( R,G,B )
-
Returns the hue of the colour with the specified RGB values.
- Colour::_luminance( R,G,B )
-
Returns the luminance of the colour with the specified RGB values.
- Colour::read_rgb( file name )
-
Reads in colours from a rgb file as used by the X11 system.
Doing something like:
use GD::Graph::bars; use GD::Graph::colour; GD::Graph::colour::read_rgb("rgb.txt") or die "cannot read colours";
Will allow you to use any colours defined in rgb.txt in your graph.
PREDEFINED COLOUR NAMES
white, lgray, gray, dgray, black, lblue, blue, dblue, gold, lyellow, yellow, dyellow, lgreen, green, dgreen, lred, red, dred, lpurple, purple, dpurple, lorange, orange, pink, dpink, marine, cyan, lbrown, dbrown.