Fixed bug and added blending to ColorUtils.average