void fil(int x, int y, int color1) {
		if (color1 == color.getRGB())
			return;
		class StackElem {
			int x, y;
		}
		ArrayList<StackElem> stack = new ArrayList<StackElem>();
		StackElem NowIs = new StackElem();
		NowIs.x = x;
		NowIs.y = y;
		stack.add(NowIs);
		while (stack.size() > 0) {
			int a = 0;
			StackElem NowIsNew = stack.remove(stack.size() - 1);
			if ((NowIsNew.x<0 || NowIsNew.y<0 || NowIsNew.x>=xSize || NowIsNew.y>=ySize))
				continue;
			int color2 = image.getRGB(NowIsNew.x, NowIsNew.y);
			int c1 = (color1 & 0xFF) - (color2 & 0xFF);
			int c2 = ((color1>>8) & 0xFF) - ((color2>>8) & 0xFF);
			int c3 = ((color1>>16) & 0xFF) - ((color2>>16) & 0xFF);
			if((Math.abs(c1) + Math.abs(c2) + Math.abs(c3) > 30)) continue;
		//	System.out.println("debug " + NowIsNew.x + " " + NowIsNew.y);
			image.setRGB(NowIsNew.x, NowIsNew.y, color.getRGB());
			StackElem NowIsNew1 = new StackElem();
			NowIsNew1.x = NowIsNew.x + 1;
			NowIsNew1.y = NowIsNew.y;
			stack.add(NowIsNew1);
			StackElem NowIsNew2 = new StackElem();
			NowIsNew2.x = NowIsNew.x;
			NowIsNew2.y = NowIsNew.y + 1;
			stack.add(NowIsNew2);
			StackElem NowIsNew3 = new StackElem();
			NowIsNew3.x = NowIsNew.x - 1;
			NowIsNew3.y = NowIsNew.y;
			stack.add(NowIsNew3);
			StackElem NowIsNew4 = new StackElem();
			NowIsNew4.x = NowIsNew.x;
			NowIsNew4.y = NowIsNew.y - 1;
			stack.add(NowIsNew4);
			// TODO
			NowIsNew = null;
		}
		this.repaint();
	}