java - integer to color -
i coding java applet visual modified version of breadth first search.
my problem trying convert number coordinated pixel on 2d array color.
code : map 2d array of values should increasing 1 go away starting location except walls set 0 , appear black.
string colorhex1 = integer.tohexstring(map[i][j]+100); g.setcolor(color.decode("#"+colorhex1)); if (map[i][j]==1) g.setcolor(color.white); else if (map[i][j]==0) g.setcolor(color.black); g.fillrect(i*10,j*10+40,10,10);
how main search works increases number of each cell next 1 unless has been touched in visualization should show increase in vibrancy farther away starting location. design have 1 start off "black" color of walls. 2 head towards purple randomly change color again , again having quite weird.
question : there way me code more gradual way of increasing color using number value of map array?
Comments
Post a Comment