fade in image javascript

I am a new-newbie in JavaScript and I am trying to write a code that fades-in a picture in commands that I am familiar with. I’ve seen several examples here but they didn’t work. This is what I tried …

Java color opacity

I have a method to determine a color based on some value. The method is as such: public Color color(double val) { double H = val * 0.3; double S = 0.9; double B = 0.9; return Color….