private static int mixLightness(int colour, int lightness, int drawType) {
		if ((drawType & 2) == 2) {
			if (lightness < 0)
				lightness = 0;
			else if (lightness > 127)
				lightness = 127;
			lightness = 127 - lightness;
			return lightness;
		}
		lightness = lightness * (colour & 0x7f) >> 7;
		if (lightness < 2)
			lightness = 2;
		else if (lightness > 126)
			lightness = 126;
		return (colour & 0xff80) + lightness;
	}