Member-only story
Create Art Paintings Using JavaScript (Beginner’s Guide To Creative Coding)
Over the past year, I fell in love with creative coding and generative art.
You basically create a script using p5js (A Javascript library), that generates … art!
I find this both creative and at the same time it gives me the ability to exercise my coding skills. I am not proficient at coding. I am a doctor, however, I have basic knowledge of Python, Javascript, HTML, and CSS which I taught myself when I was young.
This is a tutorial on how to use Javascript to create art paintings.
You will create a script that every time you run, will generate a different painting. While some basic knowledge of Javascript is required, you can also follow along even if you don’t know much yet and you just started coding.
We will use the online P5js editor
The moment you load it, you can see it has two functions.
What’s a function you may ask?
It’s basically some code designed to perform a particular task. You can learn more here
The setup function creates the canvas (the picture you see on the right. The number…