We report the detection of color gradients in six massive ( stellar mass { ( M _ { star } ) > 10 ^ { 10 } } M _ { \odot } ) and passively evolving ( specific star formation rate ( SSFR ) < { 10 ^ { -11 } yr ^ { -1 } } ) galaxies at redshift 1.3 < z < 2.5 identified in the Hubble Ultra Deep Field ( HUDF ) using ultra–deep HST ACS and WFC3/IR images . After carefully matching the different PSFs , we obtain color maps and multi–band optical/near–IR photometry ( BVizYJH ) in concentric annuli , from the smallest resolved radial distance ( \approx 1.7 kpc ) up to several times the H–band effective radius . We find that the inner regions of these galaxies have redder rest-frame UV–optical colors ( U-V , U-B and B-V ) than the outer parts . The slopes of the color gradient have no obvious dependence on the redshift and on the stellar mass of the galaxies . They do mildly depend , however , on the overall dust obscuration ( E ( B-V ) ) and rest–frame ( U-V ) color , with more obscured or redder galaxies having steeper color gradients . The z \sim 2 color gradients are also steeper than those of local early–type ones . The gradient of a single parameter ( age , extinction or metallicity ) can not fully explain the observed color gradients . Fitting the spatially resolved HST seven–band photometry to stellar population synthesis models , we find that , regardless of assumptions on the metallicity gradient , the redder inner regions of the galaxies have slightly higher dust obscuration than the bluer outer regions , implying that dust partly contributes to the observed color gradients , although the magnitude depends on the assumed extinction law . Due to the age–metallicity degeneracy , the derived age gradient depends on the assumptions for the metallicity gradient . We discuss the implications of a number of assumptions for metallicity gradients on the formation and evolution of these galaxies . We find that the evolution of the mass–size relationship from z \sim 2 to the present can not be driven by in–situ extended star formation , which implies that accretion or merger is mostly responsible for the growth of their stellar mass and size . The lack of a correlation between the strength of the color gradient and the stellar mass argues against the metallicity gradient predicted by the monolithic collapse scenario , which would require significant major mergers to evolve into the one observed at the present .