1Imager::Color::Float(3)User Contributed Perl DocumentatioInmager::Color::Float(3)
2
3
4
6 Imager::Color::Float - Rough floating point sample color 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 color space
25 calculations 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 red, green, blue and alpha channels of the color
49 the object contains.
50
51 info
52 Calling info merely dumps the relevant color to the log.
53
55 Arnar M. Hrafnkelsson, addi@umich.edu And a great deal of help from
56 others - see the "README" for a complete list.
57
59 Imager(3), Imager::Color.
60
61 http://imager.perl.org/
62
63
64
65perl v5.30.0 2019-07-26 Imager::Color::Float(3)