Graph::colour(3)
π NAME π
GD::Graph::colour β colour manipulation routines for use with GD::Graph. yes bestie, it's literally the colour department β¨
π SYNOPSIS π
use GD::Graph::colour qw(:colours :lists :files :convert);
that one line? iconic. imports everything you need in one go π«Ά
π DESCRIPTION π
okay so the GD::Graph::colour package hands you a few routines for working with colours. and the way its functionality is defined? mostly by whatever the GD::Graph modules needed, both now and historically. no cap β it's a "built to serve the graphs" situation π
β¨ FUNCTIONS β¨
πΈ colour_list( number of colours )
returns a list of number of colours colour names that the package knows about. yep, that's the whole vibe. exported with the :lists tag π
πΈ sorted_colour_list( number of colours )
same deal β returns a list of number of colours colour names known to the package, except sorted by luminance or hue. NB: right now it always sorts by luminance, fr fr. an option to decide the sorting method at run time will be added in a later stage. exported with the :lists tag β¨
πΈ _rgb( colour name )
returns a list of the RGB values of colour name. and here's the cute part β if colour name is a string of the form that's acceptable to the hex2rgb sub, then the colour gets added to the list dynamically π₯ exported with the :colours tag.
πΈ _hue( R,G,B )
returns the hue of the colour with the specified RGB values. exported with the :colours tag π¦
πΈ _luminance( R,G,B )
returns the luminance of the colour with the specified RGB values. exported with the :colours tag π
πΈ add_colour(colourname => [$r, $g, $b]) or add_colour('#7fe310')
self-explanatory, bestie π
exported with the :colours tag.
πΈ rgb2hex($red, $green, $blue) and hex2rgb('#7fe310')
these functions translate a list of RGB values into a hexadecimal string β the kind commonly used in HTML and the Image::Magick API β and vice versa. both directions, we love a two-way street π«Ά exported with the :convert tag.
πΈ read_rgb( file name )
reads in colours from an 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. main character move tbh π exported with the :files tag.
π¨ PREDEFINED COLOUR NAMES π¨
the whole roster, in order, no skips:
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.
that's 29 little icons and they all ate π
π AUTHOR π
Martien Verbruggen <mgjv@tradingpost.com.au>
π Copyright
GIFgraph: Copyright (c) 1995-1999 Martien Verbruggen. Chart::PNGgraph: Copyright (c) 1999 Steve Bonds. GD::Graph: Copyright (c) 1999 Martien Verbruggen.
all rights reserved. this package is free software; you can redistribute it and/or modify it under the same terms as Perl itself πΈ
π SEE ALSO π
GD::Graph, GD::Graph::FAQ
go read those too, iykyk π
okay that's the whole page, and yes it was giving documentation excellence the entire time π this was perl v5.42.0, dated 2024-03-22 β remember it fondly bestie, mwah π
π¦ where this page comes from
- opensuse-leap 16.0: perl-GDGraph 1.560.0-bp160.1.11 Β· (Artistic-1.0 OR GPL-1.0-or-later) AND GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms