NAME

Imager::Color - Color handling for Imager.

SYNOPSIS

  $color = Imager::Color->new($red, $green, $blue);
  $color = Imager::Color->new($red, $green, $blue, $alpha);
  $color = Imager::Color->new("#C0C0FF"); # html color specification
  $color->set($red, $green, $blue);
  $color->set($red, $green, $blue, $alpha);
  $color->set("#C0C0FF"); # html color specification
  ($red, $green, $blue, $alpha) = $color->rgba();
  @hsv = $color->hsv(); # not implemented but proposed
  $color->info();

DESCRIPTION

This module handles creating color objects used by imager. The idea is that in the future this module will be able to handle colorspace calculations as well.

new
This creates a color object to pass to functions that need a color argument.
set
This changes an already defined color. Note that this does not affect any places where the color has been used previously.
rgba
This returns the rgba code of the color the object contains.
info
Calling info merely dumps the relevant colorcode to the log.

You can specify colors in several different ways, you can just supply simple values:

You can supply named parameters:

Optionally you can add an alpha channel to a color with the 'alpha' or 'a' parameter.

These color specifications can be used for both constructing new colors with the new() method and modifying existing colors with the set() method.

AUTHOR

Arnar M. Hrafnkelsson, addi@umich.edu And a great deal of help from others - see the README for a complete list.

SEE ALSO

Imager(3) http://www.eecs.umich.edu/~addi/perl/Imager/