SetColor($color1); $img->Line($x,$y,$x+$s1*$w,$y); } else { $x = $x + $s2*$w*$r; $w = (1-$r)*$w; $h = $h / (1-$r) * $r; $s2 *= -1; $img->SetColor($color1); $img->Line($x,$y,$x,$y-$s2*$h); } $img->SetColor($color2); $img->FilledRectangle($x-1,$y-1,$x+1,$y+1); $img->Arc($x,$y,2*$w+1,2*$h+1,$sa,$ea); $img->Arc($x,$y,2*$w,2*$h,$sa,$ea); $img->Arc($x,$y,2*$w-1,2*$h-1,$sa,$ea); $img->Line($x_old,$y_old,$x,$y); $x_old=$x; $y_old=$y; } } $g = new CanvasGraph($w,$h); //$gr = 1.61803398874989484820; $p = SeaShell($g->img,0,20,$w-1,$h-21,$r,19); $g->img->SetColor('black'); $g->img->Rectangle(0,20,$w-1,$h-1); $g->img->SetFont(FF_FONT2,FS_BOLD); $g->img->SetTextAlign('center','top'); $g->img->StrokeText($w/2,0,"Canvas Spiral"); $g->Stroke(); ?>