The two discs are the quark contents of a proton ($uud$, charge $\tfrac23+\tfrac23-\tfrac13=+1$) and a neutron ($udd$, charge $\tfrac23-\tfrac13-\tfrac13=0$). Only the weak interaction changes quark flavor: an up quark emits a $W^{+}$ boson and becomes a down quark, $u\to d+W^{+}$, and the $W^{+}$ then materializes as $e^{+}+\nu_e$. The $W$ carries no color, so the converted quark keeps its strong-interaction color; the red $u$ in the top disc is the red $d$ below, while the gluon lines only indicate that the nucleon remains a color-neutral bound state.
The qualification is that the complete process $p\to n+e^{+}+\nu_e$ is forbidden for a free proton. The neutron is heavier by $m_n-m_p\approx1.293\,\mathrm{MeV}/c^2$ (
Particle Data Group neutron listing), and the positron adds $0.511\,\mathrm{MeV}/c^2$, so the products outweigh the proton by about $1.80\,\mathrm{MeV}/c^2$. Inside a nucleus, differences in binding energy can make the same conversion possible as $\beta^{+}$ decay or electron capture, $p+e^{-}\to n+\nu_e$, as in fluorine-18 used for PET imaging or in the neutronization of a collapsing stellar core. A free neutron runs the other way, $n\to p+e^{-}+\bar\nu_e$, with a mean lifetime of roughly 880 seconds.
Quark masses are also a small part of the story. The $u$ and $d$ current-quark masses are only a few $\mathrm{MeV}/c^2$ (
PDG quark-mass review), while a nucleon weighs about $939\,\mathrm{MeV}/c^2$, mostly as QCD binding energy. The small neutron-proton splitting comes from a balance between the $d$-$u$ mass difference and electromagnetic energy, and lattice QCD calculations reproduce it within their uncertainties (
Borsányi et al., Science 2015).