Question: Overview You will create a filling pattern in the Canvas. The pattern draws a series of rombuses that completely fill the Canvas. Put together an
Overview
You will create a filling pattern in the Canvas. The pattern draws a series of rombuses that completely fill the Canvas. Put together an HTML file and a JavaScript file. Your assignment folder is to be called Assignment You will name your JavaScript file pattern.js Your JavaScript file must be placed within the scripts folder in your development folder.
Your complete pattern will look this:
a This canvas might not have integer dimensions. You will need to calculate its dimensions based on the number of rhombuses drawn. Remember the canvas needs a solid border in black colour.
b You will create this matrixlike pattem by drawing rhombuses with side px All sides have equal length. As it is matrixlike drawing, you will need two loops to draw all the thombuses. Keep in mind that with a side px the internal diagonal edge to edge of the hombus is longer than that. Calculating this value is key for getting the canvas dimensions and spacing the rhombuses correctly.
c The colour changes in every rowcolumn In the columns the figures get their colours following a RedGreenBlue sequence RGB This means that column has a varying red value, no green and no blue. Column has green and no redblue components. The same applies to column As we have only main colours, column will be red and so on Row to row the amount of colour will change in increments of px the same length the side of the figures have String concatenation might help you generate your colours easily.
Note:
Your code is expected to be readable, that means having a wellorganized code with proper indentation and following recommended practices eg variable naming
Your solutions will be inspected and compared. Make sure your code is authentic. Any attempt of cheating will invalidate your solution.
Your solution must be submitted as a single ZIP file. The recommendation is to zip your entire folder. If you do not zip your folder, you will receive ZERO for this assignment.
Submission and grading
When you are finished, submit your zip file to BrightSpace. Make sure your submission happens before the deadline, remember that late submissions are not possible. Grades will be calculated as follows:
Structure and content. Styling indentation, readability, file placement
Canvas dimensions
Rhombus placement Canvas and other rhombuses
Rhombus colour correct pattern
We need yto use nested loop for the rhombus, then translate and rotate and please don't change the coordinates just play with yhthe the transltee then use if condition for the vatianvariant of volour
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
