Sorry to be pedantic. For people just discovering art from the early 20th century period, this fun project doesn't generate Cubist-style art. Cubism was a completely different genre. While Mondrian was inspired by Cubism in his earlier period, the art we think of when we think of Mondrian isn't Cubism by a long shot. Here's a good example of Cubism, Picasso's Girl with Mandolin:
https://www.pablopicasso.org/girl-with-mandolin.jsp#google_v...
And a side note. We nerds think we can generate Mondrians at will. Here's a "typical" Mondrian (he had many sub styles):
https://smarthistory.org/mondrian-composition-ii-in-red-blue...
There's even a programming language named Piet ostensibly designed to let you generate Mondrians. It has been featured here on HN:
https://www.dangermouse.net/esoteric/piet/samples.html
Notice the samples don't look anything like an actual Mondrian.