Mom's Love Orbit Drawing
- This drawing uses circles, ellipses, polygons, arcs, and text
- The center planet is representing Mom's love.
- The two orbiting circles represent my kids, Ella and Brody.
SLAVE CODE FOLLOWS
<?php
header('Content-Type: image/gif');
// === create background work area
// create a blank image
$imageWidth = 500;
$imageHeight = 360;
$image = imagecreatetruecolor($imageWidth, $imageHeight);
// color scheme
$background = imagecolorallocate($image, 245, 247, 255);
$orbitColor = imagecolorallocate($image, 160, 160, 190);
$deepBlue = imagecolorallocate($image, 30, 65, 140);
$softPink = imagecolorallocate($image, 255, 175, 205);
$brightPink = imagecolorallocate($image, 255, 95, 145);
$red = imagecolorallocate($image, 220, 30, 70);
$purple = imagecolorallocate($image, 115, 70, 160);
$yellow = imagecolorallocate($image, 255, 225, 90);
$white = imagecolorallocate($image, 255, 255, 255);
// fill background
imagefilledrectangle($image, 0, 0, $imageWidth, $imageHeight, $background);
//draw an arc
imagearc($image, 250, 180, 360, 190, 0, 360, $orbitColor);
imagearc($image, 250, 180, 290, 135, 0, 360, $orbitColor);
//draw stars
$star1 = array(
55, 35,
61, 51,
78, 51,
64, 61,
70, 78,
55, 68,
40, 78,
46, 61,
32, 51,
49, 51
);
imagefilledpolygon($image, $star1, 10, $yellow);
$star2 = array(
430, 45,
436, 61,
453, 61,
439, 71,
445, 88,
430, 78,
415, 88,
421, 71,
407, 61,
424, 61
);
imagefilledpolygon($image, $star2, 10, $yellow);
$star3 = array(
420, 270,
425, 283,
439, 283,
428, 291,
432, 304,
420, 296,
408, 304,
412, 291,
401, 283,
415, 283
);
imagefilledpolygon($image, $star3, 10, $yellow);
// draw mom's planet
imagefilledellipse($image, 250, 180, 150, 150, $softPink);
imageellipse($image, 250, 180, 150, 150, $purple);
imageellipse($image, 250, 180, 142, 142, $white);
//draw heart
imagefilledellipse($image, 226, 158, 62, 62, $red);
imagefilledellipse($image, 274, 158, 62, 62, $red);
//draw center fill so the two top circles connect smoothly
imagefilledellipse($image, 250, 177, 78, 64, $red);
//draw point for heart
$heartPoint = array(
197, 173,
303, 173,
250, 247
);
imagefilledpolygon($image, $heartPoint, 3, $red);
//add a small red bridge so the top of the heart connects cleanly
imagefilledellipse($image, 250, 152, 28, 22, $red);
//draw circles for kids
imagefilledellipse($image, 98, 215, 88, 88, $brightPink);
imageellipse($image, 98, 215, 88, 88, $purple);
imagefilledellipse($image, 410, 145, 88, 88, $deepBlue);
imageellipse($image, 410, 145, 88, 88, $purple);
//font
$font = 'fonts/arial.ttf';
//add text
imagettftext($image, 15, -10, 70, 83, $deepBlue, $font, 'Love you to the moon and back');
imagettftext($image, 18, 0, 210, 270, $purple, $font, 'Love, Mom');
imagettftext($image, 16, 0, 71, 221, $white, $font, 'Ella');
imagettftext($image, 16, 0, 376, 151, $white, $font, 'Brody');
//output
imagegif($image);
imagedestroy($image);
?>