Large planetary spin-orbit misalignments (obliquities) may strongly influence atmospheric circulation and tidal heating in the planet. A promising avenue to generate obliquities is via spin-orbit resonances, where the spin and orbital precession frequencies of the planet cross each other as the system evolves in time. One such mechanism involves a dissipating (mass-losing) protoplanetary disk that drives orbital precession of an interior planet. We study this scenario analytically in this paper, and obtain the mapping between the general initial spin orientation and the final obliquity. We show that (i) under adiabatic evolution (i.e. the disk dissipates at a sufficiently slow rate), the final planetary obliquity as a function of the initial spin orientation bifurcates into distinct tracks governed by interactions with the resonance; and (ii) under nonadiabatic evolution, a broad range of obliquities can be excited. We obtain analytical expressions for the final obliquities for various regimes of parameter space. The dynamical system studied in this paper is an example of "Colombo's top", and our analysis and results can be adapted to other applications.