PDF_setrgbcolor

(PHP 4, PECL pdflib >= 1.0.0)

PDF_setrgbcolorSet fill and stroke rgb color values [deprecated]

Description

bool PDF_setrgbcolor ( resource $p , float $red , float $green , float $blue )

Sets the current fill and stroke color to the supplied RGB values. Returns TRUE on success or FALSE on failure.

This function is deprecated since PDFlib version 4, use PDF_setcolor() instead.

Коментарии

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($pdf1106002030);
pdf_setrgbcolor_fill($pdf001.0);
pdf_fill($pdf);

?>
2000-04-26 15:17:46
http://php5.kiev.ua/manual/ru/function.pdf-setrgbcolor.html
<b>Use this code to convert HEX colors to RGB that you can use with pdf_setrgbcolor:</b>
<?
$color 
"#FF00FF";
$string str_replace("#","",$color);
$red hexdec(substr($string,0,2)) / 255;
$green hexdec(substr($string,2,2)) / 255;
$blue hexdec(substr($string,4,2)) / 255;
pdf_rect($pdf1106002030);
pdf_setrgbcolor_fill($pdf$red$green$blue);
pdf_fill($pdf);
?>

This gives you a pink rectangle!
2001-07-09 08:19:33
http://php5.kiev.ua/manual/ru/function.pdf-setrgbcolor.html

    Поддержать сайт на родительском проекте КГБ