Method and system for generating electromagnetic radiation wherein one or more attributes of the electromagnetic radiation are adjusted based on a characteristic of the object being illuminated. The object characteristic can be obtained based on a sensed property of the object and used to adjust the attribute(s) of the electromagnetic radiation accordingly.