© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
D. MatthewGenerative Art with JavaScript and SVGDesign Thinkinghttps://doi.org/10.1007/979-8-8688-0086-3_4

4. Randomness and Regularity

David Matthew1  
(1)
Limerick, Ireland
 

So far, all of our sketches (bar the first one) have lacked a certain ingredient usually considered foundational to the very genre of generative art: namely, randomness. When we surrender full control over the result of our sketches and leave certain elements to chance, it allows for variation, for exploration, and for discovery.

In this chapter, we’ll learn how to randomize parameters like colors, sizes, and coordinates; how to randomly pick from predefined ranges and arrays; and how to ...

Get Generative Art with JavaScript and SVG: Utilizing Scalable Vector Graphics and Algorithms for Creative Coding and Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.