1Imager::Handy(3) User Contributed Perl Documentation Imager::Handy(3)
2
3
4
6 Imager::Handy - simple access to common functions
7
9 use Imager ':handy';
10 my $color = NC(255, 0, 0);
11 my $font = NF(1.0, 0, 0);
12
14 If you use Imager with the ":handy" import tag, it will export a number
15 of functions that can shorter your code.
16
17 NC()
18 newcolor()
19 newcolour()
20 Create a new Imager::Color object, supplying any parameters to the
21 new() method.
22
23 my $color = NC('red');
24
25 NF()
26 newfont()
27 Create a new Imager::Font object, supplying any parameters to the
28 new() method.
29
30 my $font = NF(file => 'foo.ttf');
31
32 NCF()
33 Create a new Imager::Color::Float object, supplying any parameters
34 to the new() method.
35
36 my $colorf = NCF(1.0, 0, 0);
37
39 NC() can be mostly replaced by supplying the color name or other
40 description directly to the drawing method.
41
43 Tony Cook <tonyc@cpan.org>
44
45
46
47perl v5.32.0 2020-07-28 Imager::Handy(3)