Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Create own colors with RGB values in PDF::API2

by snoopy (Deacon)
on Feb 23, 2010 at 04:03 UTC ( #824758=note: print w/replies, xml ) Need Help??


in reply to Create own colors with RGB values in PDF::API2

You can just use an HTML like RGB hex mask, prefixed by '#':
#!/usr/bin/perl use common::sense; use PDF::API2; my $pdf = PDF::API2->new(); my $page = $pdf->page(0); my $gfx = $page->gfx; my $red_rgb = '#ff0000'; $gfx->strokecolor($red_rgb); $gfx->rect(10,100,200,200); $gfx->stroke; $pdf->saveas('/tmp/red_box.pdf');
This'll work pretty well everywhere you can specify a color.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://824758]
help
Chatterbox?
[Lady_Aleena]: s/no/not/;
[Lady_Aleena]: My blasted web host will not put perl 5.22 in /usr/bin/perl, it is in /usr/local/cpanel/ 3rdparty/bin/perl
Lady_Aleena has been banging her head against this wall for years now with no success on breaking the wall.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-04-28 06:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (519 votes). Check out past polls.