private static Color[][] getLightingMap(GameMap gmap){
		int width = gmap.getWidth();
		int height = gmap.getHeight();
		Color[][] retMap = new Color[width][height];
		for(Light l: gmap.getContainedLights()){
			int rad = l.getLightRadius();
			int lxs = l.getLightPosition().x;
			int lys = l.getLightPosition().y;
			for(int x = lxs-rad; x < lxs+rad; x++){
				for(int y = lys-rad; y < lys+rad; y++){
					if(x >= 0 && x < width && y >= 0 && y < height){
						int distance = Distance.range(x, y, lxs, lys);
						if(distance - rad <= 0){
							Color existingColor = retMap[x][y];
							Color lightColor = l.getLightColor();
							if(existingColor == null){
								float intensity = Math.max(0, 1-((distance/((float)rad))/l.getIntensity()));
								Color newColor = new Color(intensity*lightColor.getRed()/255f,intensity*lightColor.getGreen()/255f,intensity*lightColor.getBlue()/255f,distance/((float)rad));
								retMap[x][y] = newColor;
							}else{
								float alpha = (existingColor.getAlpha()/255f)*(distance/((float)rad));
								float intensity = Math.max(0, 1-((distance/((float)rad))/l.getIntensity()));
								float red = Math.max(existingColor.getRed()/255f,intensity*lightColor.getRed()/255f);
								float green = Math.max(existingColor.getGreen()/255f,intensity*lightColor.getGreen()/255f);
								float blue = Math.max(existingColor.getBlue()/255f,intensity*lightColor.getBlue()/255f);
								retMap[x][y] = new Color(red,green,blue,alpha);
							}
						}

					}
				}
			}
		}
		return retMap;
	}