Make an interactive pattern. Elements should interact with both mouse’s move and press.
I especially like the way screen printing affects the interaction of color, like in Karel Martens works:
I wanted the mouse interaction to add a similar effect to my digital pattern.
a) Make an array of squares, given a number of columns and lines.
b) Map the colors to the array index — I miss Processing’s map() function! Note: when using variables with color settings in canvas, you have to concatenate them:
ctx.strokeStyle = 'rgb('+ r +', 150,' + b + ')';
Html working here.
This is not relevant, but there was an annoying thing in the page so far: Chrome and Firefox render badly the canvas element on a Macbook Retina. I found the reason and the solution for that in this article and added it to my code.