Generative design
Javascript revisitation of a work by the artist Zachary Lieberman
Contemporary artist Zachary Lieberman's work has been given a personal makeover thanks to a new code that was created through JavaScript's p5.js library. It consists of 20 circles, to create which a createBall() function was created. Within the latter is the function lerpColor(), which handles the gradient and blends two colors to create a gradient that starts from the center and fades outward. Next, two blendModes() are chosen: BLEND and HARD_LIGHT, to make the gradients interact with each other and reproduce the color effects proper to the 'original work. Interaction with the digital painting is possible through the use of a slider that can be moved to the left or right and allows the size of the circles to be changed. The mousePressed function, through mouse click, makes it possible, on the other hand, to change the background color from black to white, and vice versa. The functionality of these interactions, depends on two variables: one related to the radii of each circle and one related to the background color. Once the slider was created within setup(), it was assigned as the radius value within draw(). To change the background color, on the other hand, the mousePressed() function was used with an if inside to make the color change happen only if the mouse is clicked on the canvas (and not, for example, on the slider). Finally, to make the interaction smoother and to lighten the code, the code was made to redraw only when the current radius is different from the previous radius.
University project
Individual
Individual
Code

Book


