note 53522 added to function.imagefilledarc

From: Date: Sat, 04 Jun 2005 19:25:11 +0000
Subject: note 53522 added to function.imagefilledarc
Groups: php.notes 
Request: Send a blank email to php-notes+get-89921@lists.php.net to get a copy of this message
For 3D-graphs you will want to have a nice shadow. Here is an easy wat to calculate a good matching shadow to a color. $color is the color for the pie-piece above, $shadow_color is the shadow under it. <?php $mask = 0; //0 for darker, 255 for brighter $percent = 0.70; //between 0.40 (very different) and 0.99 (almost the same) $R = rand(0, 124); // } between 0,124 if your background color is white $G = rand(0, 124); // } between 124,255 if your background color is black $B = rand(0, 124); // } or play with these values $RS = round($R * $percent) + round($mask * (1-$percent)); $GS = round($G * $percent) + round($mask * (1-$percent)); $BS = round($B * $percent) + round($mask * (1-$percent)); $color = imagecolorallocate( $im, $R, $G, $B); $shadow_color = imagecolorallocate( $im, $RS, $GS, $BS); ?> ---- Manual Page -- http://www.php.net/manual/en/function.imagefilledarc.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+53522 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53522&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53522&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53522&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53522&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53522&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+53522&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89921) next »