Help language development. Donate to The Perl Foundation

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



Color::Scheme - Generate color schemes from a base color


use Color::Scheme;

my $color   = "#1A3CFA" );

# this is the sugar
my @palette = color-scheme( $color, 'six-tone-ccw' );

# for this
my @palette = color-scheme( $color, color-scheme-angles<six-tone-ccw'> );

# debug flag, to visually inspect the colors
# creates "colors.html" in the current directory
my @palette = color-scheme( $color, 'triadic', :debug );


With Color::Scheme you can create schemes/palettes of colors that work well together.

You pick a base color and one of sixteen schemes and the module will generate a list of colors that harmonize. How many colors depends on the scheme.

There are 16 schemes available:

Those schemes are just lists of angles in a hash ( Color::Scheme::color-scheme-angles).

You can use the second form of the color-scheme sub to pass in your own angles if you have to.


[email protected]


Copyright © [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.