static int blendfactor(int c, int factor, int src, int dst) {
		switch (factor) {
		case 1:
			return c;
		case 2:
			return colorMul(c, src);
		case 3:
			return colorMul(c, colorSub(0xFFFFFFFF, src));
		case 4:
			return colorMul(c, dst);
		case 5:
			return colorMul(c, colorSub(0xFFFFFFFF, dst));
		case 6:
			return colorScale(c, src >>> 24);
		case 7:
			return colorScale(c, 255 - (src >>> 24));
		case 8:
			return colorScale(c, dst >>> 24);
		case 9:
			return colorScale(c, 255 - (dst >>> 24));
		default:
			return 0;
		}
	}