We know that stars have different colours because they have different energy. So blue stars have a lot of energy because the blues's frequency is very high $E = h\nu$. The colour of the star is its electromagnetic radiation which is influenced by the elements of the star. All stars issue white light, but we know that the absorption spectrum isn't a continue spectrum because some elements absorb some radiations. So does the blue star contain elements which absorb low radiations and so there are only high radiations which color the star with blu/violet? And what are these elements? How can we know if an element absorb radiations with low or high frequency?
Is your question not a contradiction in itself? You say that because of different star energies the colors occur, and then you switch this thesis with stars emitting white light, and elements absorbing the nonblue-parts.
Essentially this is not completely correct (unless I understand you wrongly). Saying that stars have different energy is not precise and I think uncorrect in this case.
What you should look into is black body radiation and Plancks law of radiation. Essentially this topic states that a higher temperature responds to different wavelengths, that are emitted off the star. Take a look at this image.
As you can see this shows the intensity dependent on wavelenght. The different curves correspond to different temperatures and higher temperatures cause more energetic radiation, thus radiation with lower wavelength and higher frequency. This so called black body radiation describes the different colors of objects at different temperatures. Think of metal that doesn't (or almost) emit visible light on its own when it is at room temperature, but heated up to sufficient temperatures it will start glowing. So yes the temperatures of stars correlate with their colors, the more detailed understanding of this comes from nuclear fusion and the different types of stars. This is represented in the Hertzsprung-Russel diagram.
The diagram represents a correlation between stellar color and size, which has to do with the nuclear processes involved in the star. I think you should research on this topic as well, as writing it out here would take some time.
But as to your final statement, yes indeed there are elements absorbing light in stars, especially in the stars outer sphere. I am sure you have heard of the Fraunhofer lines, and won't give an explanation here, but as to our current understanding of stars the color is not influenced due to complete absorption of gigantic parts of the electromagnetic spectrum, the line spectra give us clues about the elements that the star consists of, which again also has some relation to the size of the star (and its age). To understand this even better, I think the following image will help.
You see the exact correlation of stellar spectra as predicted by the black body radiation (the first image). Resonance absorption due to stellar elements cause the discrete absorption lights, the temperature however is the main factor governing the color.
The observed color of a star depends on the surface temperature of the star, not on the mixture of elements in the photosphere. Cool stars are reddish (3000-4000 K) whether they are big or small, fusing hydrogen or helium in the core. Their size is determined partly by the mass and what is fusing in the core (which depends on the age of the star).
Elements in the photosphere (the visible outer layer of the star) produce absorption lines, but these have no noticeable effect on the gross color appearance of the star. High resolution spectroscopy is used to determine the trace elements of the photosphere which helps in determining the history of the star.
Hotter stars (5000-6000 k) appear bright yellow to white and are more massive than small, red stars.
Blue stars are very hot (8000-10000 K or more) because their very large masses cause intense core compression, increasing the fusion rate in the core which makes the surface very hot. They are not blue because of different elemental makeup, although they might be slightly different due to being younger stars in general (blue stars tend to burn out faster than yellow and small red stars).