Jump to content

Specifying color in ezPDF


hadoob024

Recommended Posts

I was wondering if anyone knows how to change colors of text, shapes, etc. with ezPDF?  I read through their documentation and it says that:

 

"(r,g,b) array, defining the colour of the shading, values from 0 to 1, default is (0.8,0.8,0.8)"

 

I'm confused though.  If it's rgb colors, then I assumed that the value range would be from 0 to 255.  I'm trying to make a particular blue color.  As of now, I have the following bit of code for color:

 

'shadeCol2' => array (0,0,0.4)

 

This gets me a blue color, but the wrong shade.  And it's hard to figure out the correct shade when I don't know how to manipulate these numbers.  Anyone come across this?

Link to comment
https://forums.phpfreaks.com/topic/195799-specifying-color-in-ezpdf/
Share on other sites

Nevermind.  I just found the following:

 

"1. In EZPDF you can set the colour of the text, shapes, lines etc., the colour needs to be specified in RGB triplet, each in the range 0 to 1. Most of the tools(eg:- Colour picker, Adobe Photoshop) shows the colour in the range of 0-255 or in Hexadecimal format. If you want the colour values in the range of 0-1, divide the colour values by 255. For example Blue is rgb(0, 155, 255). You can convert it in to 0-1 range by dividing each values by 255. So the blue is rgb(0, 0.61, 1) in 0-1 range."

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.