Joined: Wed Oct 07, 2009 1:45 pm Posts: 1 Has thanked: 1 time Have thanks: 0 time
Hi everybody! I am trying to color some lines gradually, depending on one variable, speed, namely if the value of the variable is really small I need a strong color otherwise a more blurry one, even white. The variable I have is speed so it is varying between 20 and 120 usually. I tried two ways for doing this but non of them is working :-S All I get is a black color a bit less darker when speed decreases, but u can hardly see the difference. First try : float hue = (float) 0.6; float saturation = (float) (1.0 - speed / 130.0); float brightness = (float) (1.0 - speed / 130.0); g2d.setColor(Color.getHSBColor(hue, saturation, brightness)); width = 10;