I recently did a post about the watercolor stroke, a method to add a color wash along a line. I’ve extended this to use multiple colors.
You can still pass it just one color as before, using the color()
method. But now there is also a colors()
method by which you can pass in any number of colors. Watercolor stroke will choose a color from the list at random, and will use that color until one of two things happens:
- The amplitude of the wave function gets very small, or
- The stroke starts over
In either case, a new color will be chosen randomly. It’s possible the same color will be chosen!
Here is an example of the first case. Whenever the amplitude of the wave is very small, there is a chance that a new color will be chosen.
Here is an example of the second case. The stroke is drawn four times, and in each case it can start with a different color.
Any colors can be used, and here I used some fairly contrasting colors to show what is happening. But the color shifts could be much more subtle (or much more garish! You decide!)
The code for this version of the watercolor stroke is in GitLab .