How can AI be used to design UI Interfaces? I'm very new to AI.  I read somewhere that AI can be used to create GUI UI/UX design. That has fascinated me for a long time. But, since I'm very new here, I don't have any idea how it can happen. 

The usual steps to create the UI Design are:


Create Grids.
Draw Buttons/Text/Boxes/Borders/styles.
Choose Color Schemes.
Follow CRAP Principle (Contrast, Repeatition, Alignment, Proximity)


I wonder how can AI algorithms help with that. I know a bit of neural networking and the closest I can think of is the following two methods (Supervised Learning).


Draw grids manually and train the Software manually to learn proper styles until it becomes capable of giving modern results and design its own design language.
Take a list of a few websites (for example) from the internet and let the software learn and explore the source code and CSS style sheets and learn and program neurons manually until it becomes capable of making it's own unique styles.
If you see the use case, on higher level it seems to generate some visual output - the design but when seen at lower level, this design is output of some code. 

One way we can do it is to train a neural network that learns to generate code which can be seen as some form of organized text. So now can be treated as a text generation problem on which you can find a lot of literature.

pix2code is one implementation that uses this idea and even expands it. In this paper the authors took it to another level, they also used the visual part - the GUI and built an architecture that takes both the code and the GUI as input and learns to generate code. So eventually it would be capable of generating code when a simple GUI was given. 

Also there are some implementations where even the network could produce code even when a rough sketch was given.