In this thesis, I study the phase diagram of dense, locally neutral three-flavor quark matter as a function of the strange quark mass, the quark chemical potential, and the temperature, employing a general nine-parameter ansatz for the gap matrix. At zero temperature and small values of the strange quark mass, the ground state of quark matter corresponds to the color–flavor-locked (CFL) phase. At some critical value of the strange quark mass, this is replaced by the recently proposed gapless CFL (gCFL) phase. I also find several other phases, for instance, a metallic CFL (mCFL) phase, a so-called uSC phase where all colors of up quarks are paired, as well as the standard two-flavor color-superconducting (2SC) phase and the gapless 2SC (g2SC) phase. I also study the phase diagram of dense, locally neutral three-flavor quark matter within the framework of a Nambu–Jona-Lasinio (NJL) model. In the analysis, dynamically generated quark masses are taken into account self-consistently. The phase diagram in the plane of temperature and quark chemical potential is presented. The results for two qualitatively different regimes, intermediate and strong diquark coupling strength, are presented. It is shown that the role of gapless phases diminishes with increasing diquark coupling strength. In addition, I study the effect of neutrino trapping on the phase diagram of dense, locally neutral three-flavor quark matter within the same NJL model. The phase diagrams in the plane of temperature and quark chemical potential, as well as in the plane of temperature and leptonnumber chemical potential are presented. I show that neutrino trapping favors two-flavor color superconductivity and disfavors the color–flavor-locked phase at intermediate densities of matter. At the same time, the location of the critical line separating the two-flavor color-superconducting phase and the normal phase of quark matter is little affected by the presence of neutrinos. The implications of these results for the evolution of protoneutron stars are briefly discussed.