Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moar

  • Loading branch information...
commit efc6a2c833c4806cf44c61f8e9db7d68b75f587a 1 parent 61b4104
@pydanny authored
Showing with 22 additions and 1 deletion.
  1. +22 −1 JSLA/20120426.rst
View
23 JSLA/20120426.rst
@@ -195,10 +195,31 @@ Sample
ears.updateAudio(0.5);
- ctx.clearRect(0, 0, canvas.width, canvas.height);
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+
ctx.fillStyle = "rgb(80,80,80)";
var w = Math.floor(canvas.width / 3);
ctx.fillRect(0 * w, canvas.height, w, -canvas.height * ears.lows());
ctx.fillRect(1 * w, canvas.height, w, -canvas.height * ears.mids());
+ ctx.fillRect(2 * w, canvas.height, w, -canvas.height * ears.highs());
+
+With vcolors
+
+.. sourcecode:: javascript::
+
+ears.updateAudio(0.5);
+
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+ /* adding colors */
+ var red = Math.round(ears.lows()*255),
+ green = Math.round(ears.mids()*255),
+ blue = Math.round(ears.mids()*255);
+
+ ctx.fillStyle = "rgb("+red+","+green+","+blue+")";
+
+ var w = Math.floor(canvas.width / 3);
+ ctx.fillRect(0 * w, canvas.height, w, -canvas.height * ears.lows());
+ ctx.fillRect(1 * w, canvas.height, w, -canvas.height * ears.mids());
ctx.fillRect(2 * w, canvas.height, w, -canvas.height * ears.highs());
Please sign in to comment.
Something went wrong with that request. Please try again.