# How to make a 2x2x2 Rubik's Cube with Tikz? [closed] Hello, I'm new in learning Tikz. I'd appreciate if someone could code this:

I just add an Asymptote figure for comparison with existing answers. I was drawing with a 2x2x2 cube - my son's toy - on my desk, copying colors from it ^^ It seems the lights need to be improved more to show that true colors??? (I appreciate any help about this!). ``````// http://asymptote.ualberta.ca/
import three;
unitsize(1cm);
currentprojection=orthographic(3, 2, 2,zoom=.8,center=true);
light White=light(new pen[] {rgb(0.38,0.38,0.45),rgb(0.6,0.6,0.67),
rgb(0.5,0.5,0.57)},specularfactor=3,
new triple[] {4X,4Y,4Z});
currentlight=White;

surface p=scale3(2)*unitplane;
draw(shift(0,0,2)*p,yellow);
draw(p,lightgray);
draw(rotate(-90,Y)*p,red);
draw(shift(2,0,0)*rotate(-90,Y)*p,orange);
draw(rotate(90,X)*p,green);
draw(shift(0,2,0)*rotate(90,X)*p,blue);
path3[] lines=box((1,0,0),(1,2,2))^^
box((0,1,0),(2,1,2))^^
box((0,0,1),(2,2,1));
draw(scale3(2)*unitbox^^lines,black+1.5pt+opacity(.5));
``````

From another view PS: Here is my son's 2x2x2 cube ^^ 