first key point is that many of these gases are not truly colorless.
Think of it like water - water appears colorless in small quantities,
but actually has a faint blue color that is only visible in large bodies
In a similar way, methane appears colorless, but is actually what gives Neptune and Uranus their blue color (note: Uranus is sometimes depicted green due to artificial recoloring to distinguish the two).
As for Saturn and Jupiter, their color is mostly determined by clouds (reddish ammonia hydrosulfide and white ammonium clouds in different combinations), which gives them clear colors even though most of their mass is colorless.Source