Color-coded fringe projection profilometry (FPP) is one of the most important single-frame three-dimensional (3D) shape measurement techniques. Transverse chromatic aberration (TCA) in a color-coded FPP system yields imaging deviations, which will result in 3D shape measurement error. In this work, a TCA compensation method for color-coded FPP is proposed. The proposed method establishes the relationship among phase, pixel deviation, and imaging position for decreasing the 3D shape measurement error introduced by TCA. Compared to existing methods that use the relationship among depth, pixel deviation, and imaging position or polynomial fitting for each pixel, the proposed method offers the merits of precise and simple implementation, since it voids the cumulative error in-depth calculation and removes the time-consuming process of polynomial fitting for each pixel. For validation, a color-coded FPP system is established and calibrated. Two verification experiments, including a translation test and 3D shape measurement of a regular spherical object, are conducted with the calibrated system. Experimental results demonstrate that the proposed TCA compensation method is capable of effectively reducing the 3D shape measurement error caused by TCA. (c) 2025 Optica Publishing Group. All rights, including for text and data mining (TDM), Artificial Intelligence (AI) training, and similar technologies, are reserved.