  The dense core of compact stars is the natural medium for the realization of
color superconductivity. A common characteristic of such astrophysical objects
is their strong magnetic fields, especially those of the so called magnetars.
In this talk, I discuss how a color superconducting core can generate or/and
enhance the stellar magnetic field independently of a magnetohydrodynamic
dynamo mechanism. The magnetic field generator is in this case a gluonic
current which circulates to stabilize the color superconductor in the presence
of a strong magnetic field or under the pairing stress produced in the medium
by the neutrality and $\beta$-equilibrium constraints.
