1Imager::Color::Float(3)User Contributed Perl DocumentatioInmager::Color::Float(3)
2
3
4

NAME

6       Imager::Color::Float - Rough floating point sample color handling
7

SYNOPSIS

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

DESCRIPTION

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

METHODS

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
54       red
55       green
56       blue
57       alpha
58           Returns the respective component as a floating point value
59           typically from 0 to 1.0.
60

AUTHOR

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

SEE ALSO

66       Imager(3), Imager::Color.
67
68       http://imager.perl.org/
69
70
71
72perl v5.32.1                      2021-01-27           Imager::Color::Float(3)
Impressum