Concept
For this week, I was inspired by Conway’s Game of Life. I used the same rules as the Game of Life’s cellular automaton; the rules are as follows:
- Alive cells with 2 or 3 neighbours stay alive
- Dead cells with exactly 3 neighbours become alive
- All other cells become dead
When I applied these rules to my sketch, I found it made an intricate design. I added to the generative effect by adding transparency to both the background and the hues of each cell. I handled the colours of the cell through the HSB colour model, which set the colour mode by determining the base colour, vividness, and brightness. All together, this makes the colour of the cells subtlety change, and have a glowing effect. When “c” is pressed on the keyboard, the cells change from having a colour changing effect to a rainbow effect
Code Snippet
class Cell { constructor(state, x, y, w) { this.state = this.previous = state; // Current and previous states this.x = x; // X-coordinate this.y = y; // Y-coordinate this.w = w; // Size (width and height) this.hue1 = random(300, 360); // Random hue for color scheme 1 this.hue2 = random(360); // Random hue for color scheme 2 this.alpha = 100; // Initial transparency }
Embedded Sketch
Reflections
I am very proud of this week’s sketch. One thing I need to trouble shoot is the first hue (hue1) being different than what I set it to. I intended it to only range in pink/red/purple tones, but right now it’s ranging in every colour. I also would add instruction on pressing “c” for the colour change.