Jump to content

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."

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.