Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Create own colors with RGB values in PDF::API2

by manua (Novice)
on Feb 22, 2010 at 22:16 UTC ( #824720=perlquestion: print w/ replies, xml ) Need Help??
manua has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

I am using PDF::API2 module and for different fonts and lines, I want to use custom colors, created with RGB values.

How can I create custom colors with the RGB Values. Any help in this regard will be highly appreciated.

Thanks, Manu

Comment on Create own colors with RGB values in PDF::API2
Replies are listed 'Best First'.
Re: Create own colors with RGB values in PDF::API2
by Anonymous Monk on Feb 22, 2010 at 23:02 UTC
Re: Create own colors with RGB values in PDF::API2
by snoopy (Deacon) on Feb 23, 2010 at 04:03 UTC
    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: perlquestion [id://824720]
Approved by AnomalousMonk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2015-09-04 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (148 votes), past polls