Artist Statement:
I decided to work with abstract objects and test my skills in using lines, shapes, and gradients. This project was the most difficult of the semester and I wish I had a better understanding of how code works but it's one of those things that requires patience and practice, practice, practice! Please find my code for the project below:
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
////////////////////////////////////// start below this line ˇˇˇˇˇˇˇˇˇˇ
context.beginPath();
context.rect(0, 0, 800, 600);
var grd = context.createRadialGradient(400, 300, 300, 400, 300, 400);
grd.addColorStop(0, 'purple');
grd.addColorStop(1, 'gray');
context.fillStyle = grd;
context.lineWidth = 35;
context.fill();
context.stroke();
context.beginPath();
context.moveTo(135, 250);
context.lineTo(350, 500);
context.lineTo(650, 500);
context.stroke();
context.fillStyle = 'pink';
context.fill();
context.beginPath();
context.moveTo(275, 400);
context.lineTo(175, 350);
context.lineTo(650, 500);
context.stroke();
context.fillStyle = 'white';
context.fill();
////////////////////////////////////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
};
</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>
No comments:
Post a Comment