Imager::Color::Float(3pm) | User Contributed Perl Documentation | Imager::Color::Float(3pm) |
Imager::Color::Float - Rough floating point sample color 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 my $c8 = $color->as_8bit; $color->info();
This module handles creating color objects used by Imager. The idea is that in the future this module will be able to handle color space calculations as well.
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:
An alpha value of zero is fully transparent, an alpha value of 1.0 is fully opaque.
The new() and set() methods can accept the following parameters:
rgb(50% 50% 100%) rgb(0, 0, 255) rgb(0.5 0.5 1.0 / 0.8) rgb(50%, 50%, 100%, 80%)
This accepts some colors not accepted by the CSS rgb() specification, this may change.
Arnar M. Hrafnkelsson, addi@umich.edu And a great deal of help from others - see the "README" for a complete list.
Imager(3), Imager::Color.
http://imager.perl.org/
2023-01-11 | perl v5.36.0 |