public double photosynthesizeAt(double x, int y, Color leafColour, Color shadowColour)
			{
				double energyGained = 0;
				// minus shadow to stop leaf shading itself
				int[] availableLight = lightMap.getLightMinusShadowAt((int) x, y, shadowColour);
				energyGained += Math.max(0, (availableLight[0] - leafColour.getRed()));
				energyGained += Math.max(0, (availableLight[1] - leafColour.getGreen()));
				energyGained += Math.max(0, (availableLight[2] - leafColour.getBlue()));
				/*
				 * The leaf colour represents the light a leaf DOESN'T absorb.
				 */
				/*
				 * If energy gained is over 255 the extra energy is subtracted
				 * from the energy gained. In nature photosynthesis is inhibited
				 * by too much light and dark adapted species are actually at a
				 * large disadvantage in normal conditions.
				 */
				if (energyGained > 200)
					energyGained = Math.max(0, 200 - (energyGained - 200));

				return energyGained;
			}