note 32987 added to function.pdf-setrgbcolor-fill
| From: | philipp dot maske at location-bretagne dot de | Date: | Thu, 12 Jun 2003 23:33:50 +0000 |
| Subject: | note 32987 added to function.pdf-setrgbcolor-fill | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50257@lists.php.net to get a copy of this message | ||
It took some time to understand, that the float values have to be beetween beetween 0 and 1. If you
use graphic tools like color-pickers etc. it is necessary to convert the RGB values frome the scale
of 1 to 255 to 0 to 1.
Use this small function to make your life easier:
function pdf_setrgbcolor_fill_better($intPdfObj, $intRed, $intGreen, $intBlue) {
if($intRed<=0||$intRed>255|| $intGreen<=0|| $intGreen>255|| $intBlue<=0||
$intBlue>255) return false;
$floatRed = $intRed/255;
$floatGreen = $intGreen/255;
$floatBlue = $intBlue/255;
return pdf_setrgbcolor_fill ($intPdfObj, $floatRed, $floatGreen, $floatBlue);
}
Have Fun!
Philipp
--
Mail: philipp.maske@location-bretagne.de
WWW: http://www.location-bretagne.de
----
Manual Page -- http://www.php.net/manual/en/function.pdf-setrgbcolor-fill.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32987
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32987&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32987&report=yes