Hello Motif!

What’s start as “how can I use or recreate textures.js pattern in Canvas?” evolve to a new lib that can generate pattern for SVG environment or Canvas context.

Any angle rotation is supported and all shapes built in are drawn based on their relative size to the tile. A size of 50% means that the shape will cover half of the tile’s area. It’s a great feature to create a palette of pattern as a gradient of color.

Custom shape can be added as SVG string path or Canvas path method (thanks to d3.path())

And it works with Plot, as shown in one of the examples.

Any suggestions are welcome!

2 Likes