It should be possible to specify that transform() should only render bricks in the official Lego brick colors (http://lego.wikia.com/wiki/Colour_Palette)
This is probably tricky to do using the current implementation, and may require some additional image processing.
See JuanPotato/Legofy#2 for reference.