The function of absorbing and responding to incidental electromagnetic radiation, particularly visible light. The response may involve a change in conformation.