note 80646 added to function.hexdec
| From: | maddddidley at yahoo dot com | Date: | Sun, 27 Jan 2008 08:17:56 +0000 |
| Subject: | note 80646 added to function.hexdec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135435@lists.php.net to get a copy of this message | ||
Function that combines two rgb colors.
function combineColors($color1, $color2) {
$color1 = str_replace("#", '', $color1);
$color2 = str_replace("#", '', $color2);
$r1 = hexdec(substr($color1, 0, 2));
$g1 = hexdec(substr($color1, 2, 2));
$b1 = hexdec(substr($color1, 4, 2));
$r2 = hexdec(substr($color2, 0, 2));
$g2 = hexdec(substr($color2, 2, 2));
$b2 = hexdec(substr($color2, 4, 2));
$r3 = ceil(($r1 + $r2) / 2);
$g3 = ceil(($g1 + $g2) / 2);
$b3 = ceil(($b1 + $b2) / 2);
$color = rgbhex($r3, $g3, $b3);
return $color = str_replace("#", '', $color);
}
----
Server IP: 209.41.74.194
Probable Submitter: 75.132.200.60
----
Manual Page -- http://www.php.net/manual/en/function.hexdec.php
Edit -- https://master.php.net/note/edit/80646
Del: integrated -- https://master.php.net/note/delete/80646/integrated
Del: useless -- https://master.php.net/note/delete/80646/useless
Del: bad code -- https://master.php.net/note/delete/80646/bad+code
Del: spam -- https://master.php.net/note/delete/80646/spam
Del: non-english -- https://master.php.net/note/delete/80646/non-english
Del: in docs -- https://master.php.net/note/delete/80646/in+docs
Del: other reasons-- https://master.php.net/note/delete/80646
Reject -- https://master.php.net/note/reject/80646
Search -- https://master.php.net/manage/user-notes.php