Because certain objects can absorb specific wavelengths of light(color) and they reflect the waves that they cannot absorb. the reflected wave of light is the visible color of the object.
The question is a little off. Sunlight isn't 'attracted' to anything, in the sense that light 'wants to move toward' certain colors. But when light shines on objects of different colors, different parts of the light are reflected off of the objects and absorbed by the objects. An object that is close to a very pure white color will reflect most of the light that shines on it; an object that is close to a very pure black color will absorb most of the light that shines on it, and so will absorb more energy.
Red: absorbedOrange: absorbedYellow: absorbedGreen: absorbedBlue: absorbedIndigo: absorbedViolet: reflected
it reflects violet and absorbs the other colors
White light contains all the wavelengths of the visible spectrum at equal intensity. The different colors of light, except violet, are absorbed when white light shines on an opaque violet object. The violet color is reflected.
This applies not only to opaque objects. The basic idea is that white light is a mixture of different colors, and objects tend to reflect the different colors - the components of white light - in different proportions. For example, an object that reflects most of the red light but not much of the other colors will look red.
The diamond acts as a prism breaking the light into different wavelengths.
it depends on what kind of object is that
When ordinary visible light shines on a prism.
When white light shines on the CD, the light is separated into seven colours, so different colours appear on the CD.
it reflects violet and absorbs the other colors
They do because of the absorption of the light from the sun!!! I think not sure
it shines as color blue