{
    "mode": "perldoc",
    "parameter": "GD::Graph::colour",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/GD%3A%3AGraph%3A%3Acolour/json",
    "generated": "2026-06-10T13:42:48Z",
    "synopsis": "use GD::Graph::colour qw(:colours :lists :files :convert);",
    "sections": {
        "NAME": {
            "content": "GD::Graph::colour - Colour manipulation routines for use with GD::Graph\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use GD::Graph::colour qw(:colours :lists :files :convert);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The GD::Graph::colour package provides a few routines to work with colours. The functionality of\nthis package is mainly defined by what is needed, now and historically, by the GD::Graph\nmodules.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "colourlist( *number of colours* )\nReturns a list of *number of colours* colour names known to the package. Exported with the\n:lists tag.\n\nsortedcolourlist( *number of colours* )\nReturns a list of *number of colours* colour names known to the package, sorted by luminance or\nhue. NB. Right now it always sorts by luminance. Will add an option in a later stage to decide\nsorting method at run time. Exported with the :lists tag.\n\nrgb( *colour name* )\nReturns a list of the RGB values of *colour name*. if the colour name is a string of the form\nthat is acceptable to the hex2rgb sub, then the colour will be added to the list dynamically.\nExported with the :colours tag.\n\nhue( *R,G,B* )\nReturns the hue of the colour with the specified RGB values. Exported with the :colours tag.\n\nluminance( *R,G,B* )\nReturns the luminance of the colour with the specified RGB values. Exported with the :colours\ntag.\n\naddcolour(colourname => [$r, $g, $b]) or\naddcolour('#7fe310')\nSelf-explanatory. Exported with the :colours tag.\n\nrgb2hex($red, $green, $blue)\nhex2rgb('#7fe310')\nThese functions translate a list of RGB values into a hexadecimal string, as is commonly used in\nHTML and the Image::Magick API, and vice versa. Exported with the :convert tag.\n\nreadrgb( file name )\nReads in colours from a rgb file as used by the X11 system.\n\nDoing something like:\n\nuse GD::Graph::bars;\nuse GD::Graph::colour;\n\nGD::Graph::colour::readrgb(\"rgb.txt\") or die \"cannot read colours\";\n\nWill allow you to use any colours defined in rgb.txt in your graph. Exported with the :files\ntag.\n",
            "subsections": []
        },
        "PREDEFINED COLOUR NAMES": {
            "content": "white, lgray, gray, dgray, black, lblue, blue, dblue, gold, lyellow, yellow, dyellow, lgreen,\ngreen, dgreen, lred, red, dred, lpurple, purple, dpurple, lorange, orange, pink, dpink, marine,\ncyan, lbrown, dbrown.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Martien Verbruggen <mgjv@tradingpost.com.au>\n",
            "subsections": [
                {
                    "name": "Copyright",
                    "content": "GIFgraph: Copyright (c) 1995-1999 Martien Verbruggen. Chart::PNGgraph: Copyright (c) 1999 Steve\nBonds. GD::Graph: Copyright (c) 1999 Martien Verbruggen.\n\nAll rights reserved. This package is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "GD::Graph, GD::Graph::FAQ\n",
            "subsections": []
        }
    },
    "summary": "GD::Graph::colour - Colour manipulation routines for use with GD::Graph",
    "flags": [],
    "examples": [],
    "see_also": []
}