I wonder how to imitate watercolors in JavaScript. For instance, I would like to fill a shape in the screen as if it were painted with watercolors. Is there any JavaScript library for that?
Asked
Active
Viewed 2,003 times
0
-
2The definition of which being... what? Gradual fade out of the color as if it had been painted with a brush? Uneven color distribution? Colors mixing together? Either way, this is borderline off-topic. You'll hardly get somebody to create the algorithm from scratch for you here, and if there's already a library Google is better suited to find it. – deceze Nov 17 '12 at 11:53
-
@deceze Thanks. I will probably think a bit more and rephrase the question. – Michael Nov 17 '12 at 12:00
1 Answers
1
Because a "watercolor" effect can take many forms in terms of the staining and where colors become more transparent or more opaque, this could end up being quite specific to the shape in question that you want to fill.
Only solution I can think of is:
Prepare a number of scalable background images with watercolor effects. This will give you a selection to choose from which you can use to fill your shape or div.
Load up the background images dynamically and set the background of the shape to the relevant image when selected.
See Set an Image object as a div background image using javascript