Help language development. Donate to The Perl Foundation

Color::Names cpan:HOLLI last updated on 2017-10-20



Color::Names - A comprehensive? list of named colors


use Color::Names;

# a hash of normalized color names associated
# with rgb values and a pretty name
say Color.Names.color-data("X11");

# you can mix sets, the later one wins in case of
# name clashes
say Color.Names.color-data("X11", "XKCD");

use Color::Names::X11;
say Color::Names::X11.color-data{'Aqua'};
# --> { rgb => [0x00, 0xff, 0xff], name => 'Aqua' }

use Color::Data::CSS3 :colors;
say COLORS{'red'};
# --> { rgb => [0xff, 0x00, 0x00], name => Red' }


You can choose from (currently) three color sets: X11, CSS3 and the xkcd set from the xkcd color survey.

The X11 and CSS3 sets are basically identical, except for 4 colors.

If you know about other lists of name/color pairs in use, please let me know.


Markus «Holli» Holzer


Copyright © Markus Holzer ( [email protected] )

License <GPLv3|: The GNU General Public License, Version 3, 29 June 2007

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.