1Imager::Color::Float(3)User Contributed Perl DocumentatioInmager::Color::Float(3)
2
3
4
6 Imager::Color::Float - Rough floating point sample colour handling
7
9 $color = Imager::Color->new($red, $green, $blue);
10 $color = Imager::Color->new($red, $green, $blue, $alpha);
11 $color = Imager::Color->new("#C0C0FF"); # html color specification
12
13 $color->set($red, $green, $blue);
14 $color->set($red, $green, $blue, $alpha);
15 $color->set("#C0C0FF"); # html color specification
16
17 ($red, $green, $blue, $alpha) = $color->rgba();
18 @hsv = $color->hsv(); # not implemented but proposed
19
20 $color->info();
21
23 This module handles creating color objects used by imager. The idea is
24 that in the future this module will be able to handle colorspace calcu‐
25 lations as well.
26
27 A floating point Imager color consists of up to four components, each
28 in the range 0.0 to 1.0. Unfortunately the meaning of the components
29 can change depending on the type of image you're dealing with:
30
31 · for 3 or 4 channel images the color components are red, green,
32 blue, alpha.
33
34 · for 1 or 2 channel images the color components are gray, alpha,
35 with the other two components ignored.
36
37 An alpha value of zero is fully transparent, an alpha value of 1.0 is
38 fully opaque.
39
41 new This creates a color object to pass to functions that need a color
42 argument.
43
44 set This changes an already defined color. Note that this does not
45 affect any places where the color has been used previously.
46
47 rgba
48 This returns the rgba code of the color the object contains.
49
50 info
51 Calling info merely dumps the relevant colorcode to the log.
52
54 Arnar M. Hrafnkelsson, addi@umich.edu And a great deal of help from
55 others - see the README for a complete list.
56
58 Imager(3), Imager::Color.
59
60 http://imager.perl.org/
61
62
63
64perl v5.8.8 2008-03-28 Imager::Color::Float(3)