Colors and Fonts in GD::Graph
All GD::Graph color routines that take
colorname as a parameter expect a string
with the name of a valid color. GD::Graph comes bundled with the
GD::Graph::colour[5] package, which provides some methods for organizing and
manipulating color name strings. GD::Graph has 29 predefined color
name strings (see Table 4-1). The module is
normally used simply to provide access to the standard color names,
but it also provides methods for converting between color
representations. You can define additional strings in an external file
by using the read_rgb( )
method.
Color name string | Red | Green | Blue | Hex representation |
| 255 | 255 | 255 |
|
| 255 | 255 | 0 |
|
| 255 | 215 | 0 |
|
| 0 | 255 | 255 |
|
| 255 | 183 | 193 |
|
| 191 | 191 | 191 |
|
| 255 | 183 | 0 |
|
| 210 | 180 | 140 |
|
| 0 | 255 | 0 |
|
| 191 | 191 | 0 |
|
| 255 | 127 | 0 |
|
| 255 | 105 | 180 |
|
| 0 | 191 | 0 |
|
| 127 | 127 | 255 |
|
| 127 | 127 | 127 |
|
| 127 | 127 | 0 |
|
| 0 | 127 | 0 |
|
| 255 | 0 | 255 |
|
| 165 | 42 | 42 |
|
| 63 | 63 | 63 |
|
| 191 | 0 | 191 |
|
| 255 | 0 | 0 |
|
| 191 | 0 | 0 |
|
| 127 | 0 | 127 |
|
| 127 | 0 | 0 |
|
| 0 | 0 | 255 |
|
| 0 | 0 | 191 |
|
| 0 | 0 | 127 |
|
| 0 | 0 | 0 |
|
Call the use method with the :colours tag to import the functions
_rgb( ), _hue( ), and _luminance( ). The :lists tag imports only colour_list( ) and sorted_colour_list( ), and the :files tag imports the read_rgb( ) function.
The various ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access