note 5358 modified in function.pdf-setrgbcolor by felipe
| From: | felipe@php.net | Date: | Sun, 20 Jul 2008 23:40:31 +0000 |
| Subject: | note 5358 modified in function.pdf-setrgbcolor by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142360@lists.php.net to get a copy of this message | ||
Here is a snippet of code to create a blue rectangle:
<?php
/*
*pdf_setrgbcolor(pdf_file, float red, float green, float blue);
*red/green/blue are values between 0 and 1.
*It appears that the value is supposed to be a percentage intensity.
*0.0 means a 0% intensity for that color (0 in RGB-scale)
*0.5 means a 50% intensity of that color (127 in RGB-scale)
*1.0 means a 100% intensity of that color (255 in RGB-scale)
*/
//Create blue rectangle
pdf_rect($pdf, 110, 600, 20, 30);
pdf_setrgbcolor_fill($pdf, 0, 0, 1.0);
pdf_fill($pdf);
?>
--was--
/*
*pdf_setrgbcolor(pdf_file, float red, float green, float blue);
*red/green/blue are values between 0 and 1.
*It appears that the value is supposed to be a percentage intensity.
*0.0 means a 0% intensity for that color (0 in RGB-scale)
*0.5 means a 50% intensity of that color (127 in RGB-scale)
*1.0 means a 100% intensity of that color (255 in RGB-scale)
*/
Here is a snippet of code to create a blue rectangle:
<pre>
//Create blue rectangle
pdf_rect($pdf, 110, 600, 20, 30);
pdf_setrgbcolor_fill($pdf, 0, 0, 1.0);
pdf_fill($pdf);
</pre>
http://php.net/manual/en/function.pdf-setrgbcolor.php