Doodle Draw
This is a basic implementation of a program to draw doodles, using random colors.
It demonstrates:
- working with colors
- random RGB color selection
- input and event handling
- current and previous frame mouse positioning
From here, you can add additional features such as:
- buttons to select different colors and brush sizes
- draw with stamps or photos
- the ability to save one's drawing to the computer
- a reset button to clear the screen
- randomly selected prompts that suggest what to draw
- a symmetrical drawing mode
- more experimental features!
For more ideas, check out Meeting Mr. Kid Pix.

require("L5")
function setup()
size(800,600)
windowTitle("Drawing software")
background("midnightblue")
strokeWeight(5)
describe("A drawing program in a midnight blue window producing random colors each time you draw.")
end
function mouseDragged()
line(mouseX, mouseY, pmouseX, pmouseY)
end
function mousePressed()
stroke(random(255),random(255),random(255))
end
Related References
Related Examples
- 10print variations - An implementation of the classic maze-drawing algorithm
- Basic Pong - A simple program demonstrating a basic implementation of pong with enemy AI player
- Copy Image Data - Paint from an image file onto the canvas.