Graphic JavaScript


Back to index
COLORFUL HEXAGONS:
This first example features a total of seven hexagons of different colors. Two functions are utilized in this little applet. One is called rgb and it converts RGB values into a form that can be used to set the value for fillStyle. The other function is called hex and it takes three values to create a small hexagon at the location and of the color specified.
Your browser does not support the HTML5 canvas tag.

ASSIGNMENT:

Your job will be to add a fourth layer to the cluster of hexagons displayed below. This will require that you plot eighteen hexagons around the perimeter of the cluster shown here. Additionally, the center of your cluster should be light blue and each concentric layer should be a perceptibly darker shade of blue.
Your browser does not support the HTML5 canvas tag.