Section: User Contributed Perl Documentation (3)
Return to Main Contents
Imager::Color::Float - Rough floating point sample colour handling
$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
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
A floating point Imager color consists of up to four components, each
in the range 0.0 to 1.0. Unfortunately the meaning of the components
can change depending on the type of image you're dealing with:
for 3 or 4 channel images the color components are red, green, blue,
for 1 or 2 channel images the color components are gray, alpha, with
the other two components ignored.
An alpha value of zero is fully transparent, an alpha value of 1.0 is
This creates a color object to pass to functions that need a color argument.
This changes an already defined color. Note that this does not affect any places
where the color has been used previously.
This returns the rgba code of the color the object contains.
Calling info merely dumps the relevant colorcode to the log.
Arnar M. Hrafnkelsson, firstname.lastname@example.org
And a great deal of help from others - see the README for a complete
- SEE ALSO
linux.jgfs.net manual pages