Skip to main content

First Homework

MY CODE:

<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
////////////////////////////////////// start below this line ˇˇˇˇˇˇˇˇˇˇ

var x1 =50;
var y1 =50;
var x2 =750;
var y2 =500;
var rectx1 = 50;
var recty1 = 100;
var rectwidth1 = 300;
var rectheight1 = 250;
var grd = context.createLinearGradient(rectx1, recty1, rectx1+rectwidth1, recty1+rectheight1);
var rectx2  = 300;
var recty2 = 300;
var rectwidth2 = 200;
var rectheight2 = 300;
var x3= 300;
var y3= 60;
var x4= 100;
var y4= 500;
var rectx3  = 555;
var recty3 = 100;
var rectwidth3 = 150;
var rectheight3 = 150;
var x5= 600;
var y5= 150;
var x6= 550;
var y6= 500;

//orange line
context.beginPath();
  context.moveTo(x3,y4);
  context.lineTo(x1,y6);
  context.lineWidth = 10;
  context.strokeStyle = 'rgb(255,165,0)';
  context.lineCap = 'butt';
  context.stroke();

//light blue line
  context.beginPath();
  context.moveTo(x1,y1);
  context.lineTo(x2,y2);
  context.lineWidth = 5;
  context.strokeStyle = 'rgb(0,250,250)';
  context.lineCap = 'round';
  context.stroke();

//red and yellow rectangle2
  context.beginPath();
context.rect(rectx3,recty1,rectwidth2,rectheight2);
context.lineWidth = 15;
context.strokeStyle = 'rgb(250,250,100)';
context.fillStyle = 'red';
  context.fill();
context.stroke();

//light blue line
  context.beginPath();
  context.moveTo(x1,y5);
  context.lineTo(x2,y3);
  context.lineWidth = 10;
  context.strokeStyle = 'rgb(100,200,250)';
  context.lineCap = 'round';
  context.stroke();

// rectangle 1
  context.beginPath();
context.rect(rectx1,recty1,rectwidth1,rectheight1);
context.lineWidth = 10;
context.strokeStyle = 'rgb(235,280,0)';
// starting gradient color
        grd.addColorStop(0, "rgb(235,281,0)");
        //intermediate color
        grd.addColorStop(0.5, "rgb(193,24,0)");
        // ending color
        grd.addColorStop(1, "rgb(255,100,0)");
context.fillStyle = grd;
context.fill();
context.stroke();


//Simple V line in purple

var x= 50;
var y = 100;
var x1 = 300;
var y1 = 450;
var x2 = 400;
var y2 = 300
var x3 = 500;
var y3 = 450
var x4 = 700;
var y4 = 100
//comment
context.beginPath();
context.moveTo(x, y);
context.lineTo(x1, y1); // move to starting coordinates
context.lineTo(x2, y2); // draw line to following point
context.lineTo(x3, y3)
context.lineTo(x4, y4)
context.lineCap = 'round';
context.lineWidth = 30;// declare the width in pixels of the line
context.strokeStyle = 'rgb(100,0,205)'; // or "#FF0000" // declare the line color in rgb or hexadecimal values

context.stroke();


////////////////////////////////////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ

};
</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>

Comments

Popular posts from this blog

Tag Brush

TAG BRUSH ARTIST STATEMENT:          The piece I have created is a tag brush of my previously created travel logo. This brush can be used as a stamp and can be place wherever desired. The composition above shows the brush stamped a few times to create a psychedelic blue and purple effect that is visually appealing.          As stated before when describing my logo, this piece highlights my traveling and yearn to explore the world and other cultures. What is interesting about this composition specifically is that the logo is now a stamp that can be easily transferred and simply pasted on any other work of art. This makes it accessible and allows for it to be changed to multiple different colors and looks depending on what is necessary.         Overall, this tagbrush is relevant in being able to use the logo I created and apply it to other compositions. It can be made visually appealing and fitting to whatever color and look it needs to have, and is a simple way to put the log

Self Portrait Poster

SELF PORTRAIT POSTER ARTIST STATEMENT:         The piece that I have created is a self portrait poster that represents myself in a propaganda type manner. I used a recent photo of myself to create a simple composition in every way possible except for my face. With my face, I aimed to use color to create the highlights and shadows from the original image through a variety of colorful shapes. In doing this, I aimed to create a visually appealing, colorful composition that still fit the criteria of the poster assignment.          My self portrait poster is based on the quote "always dream in color." I decided to create my piece to exemplify the idea of living life to it's greatest extents and to live your best life- in a propaganda style. I used a large amount of different lines and shapes to make my face look as realistic as possible and relate similarly to the original image. I chose to put the quote on one side of the image rather than both sides or center

Calligram

GRETA THUNBERG - CLIMATE ACTION SPEECH.  This image is a calligram representing Greta Thunberg's climate action speech symbolized through an image of the world.