note 31644 added to function.pdf-setcolor
| From: | php at rack1 dot php dot net | Date: | Tue, 29 Apr 2003 05:59:33 +0000 |
| Subject: | note 31644 added to function.pdf-setcolor | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47233@lists.php.net to get a copy of this message | ||
Here's a function for converting HTML hexadecimal colors to RGB decimals suitable for this
function:
$color_hex = "FF0000"; ## whatever hex color you want
$color = convert_hexcolor_rgbdec($color_hex);
pdf_setcolor($pdf, 'fill', 'rgb', $color['r'], $color['g'],
$color['b']);
function convert_hexcolor_rgbdec($color_hex)
{
$color['r'] = hexdec(substr($color_hex, 0, 2))/255;
$color['g'] = hexdec(substr($color_hex, 2, 2))/255;
$color['b'] = hexdec(substr($color_hex, 4, 2))/255;
return $color;
}
-Derek
--
http://www.php.net/manual/en/function.pdf-setcolor.php
http://master.php.net/manage/user-notes.php?action=edit+31644
http://master.php.net/manage/user-notes.php?action=delete+31644
http://master.php.net/manage/user-notes.php?action=reject+31644