Skip to content

Instantly share code, notes, and snippets.

@kenwilcox
Created May 17, 2014 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenwilcox/bbdda9fa1f78ea590841 to your computer and use it in GitHub Desktop.
Save kenwilcox/bbdda9fa1f78ea590841 to your computer and use it in GitHub Desktop.
A Pen by kenwilcox.
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/alphabet.js"></script>
</head>
<body>
<div id="canvas">
<canvas id="myCanvas"></canvas>
</div>
<script type="text/javascript" src="http://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/bubbles.js"></script>
</body>
</html>

Roy G. Biv

Playing with bubbles.js on codecademy.com, thought it would be fun to use the whole rainbow.

A Pen by kenwilcox on CodePen.

License.

function updateCanvasDimensions() {
canvas.attr({
height: 200,
width: 1000
});
canvasWidth = canvas.width();
canvasHeight = canvas.height();
draw();
}
var myName = "Roy G Biv";
// Colors are in HSL not RGB
var red = [0, 100, 63];
var orange = [40, 100, 60];
var yellow = [55, 100, 50];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var indigo = [255, 100, 63];
var violet = [280, 50, 60];
var letterColors = [red, orange, yellow, green, blue, indigo, violet];
drawName(myName, letterColors);
bubbleShape = 'square';
//bubbleShape = 'circle';
//bounceName();
bounceBubbles();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment