In the retina I believe it is chemicals that selectively resonate to different optical wavelengths. Those then trigger the action potential. (Actually, it’s in reverse, iir— darkness is maximal firing rate and light inhibits the rate of firing). I’ll look it up later and post back.
Note that in the ear, the basilar membrane also affects sound perception, based on selective resonance effects, ensuring that a specific band of hair cells are most likely to phase lock to the sounds. There is both space encoding (ie where on the basilar membrane) and time encoding (phase locking to the signal).
I can confirm that all of this checks out except for the chemical "resonance" in the cones in the retina. It is fascinatingly complex how the molecules are tuned to selectively absorb energy in particular bands of the visible spectrum. Whether one would call this resonance or not will hinge on the definition (fwiw, the definition of resonance in physics can be exceedingly broad).