Formation and transformation of colloidal nanocrystals