Color clearColor = new Color(0,0,0,0);
for(Color[] l:toolColors)
for(int i = 0; i < y; i++)
l[i] = clearColor;;
//create Line
Line c = new Line(new Point(xt, yt),
new Point(startX, startY));
Point[] ps = c.getPoints();
for(Point p:ps)
if(p.x >= 0 && p.x < x && p.y >= 0 && p.y < y)
toolColors[p.x][p.y] = clickColors[buttonPressed + clickCount - 1];
repaint();