We will see how to generate a SVG background with triangle patterns in ruby to have something that look likes this:
At first, install the TrianglePattern gem:
Then we only need a very short script with some simple options:
- an array of color (a gradient preferably) that we can generate with a website like https://cssgradient.io/
- the width and height of the image
cell_size
: size of the mesh used to generate trianglesvariance
: amount of randomness used when generating trianglesseed
: seed of the random generator