It was made using Haskell.
Actually, I'll list below how the animation evolved. Long story short, I decided in the final variants to cast the RGB cube surface on the big square, then animating it.
* https://gfycat.com/InsidiousPresentGoa
* https://gfycat.com/SpiffyFaithfulBanteng
* https://gfycat.com/PracticalFatKentrosaurus
* https://gfycat.com/CheapMisguidedBufflehead
* https://gfycat.com/InsidiousSphericalAzurewingedmagpie
* https://gfycat.com/HollowGlaringGraywolf
* https://gfycat.com/WillingBothGoose