/** * Creates a new color with the provided {@code Colors}. * * @param colors The provided colors to mix * @return The new color */ public Color mixWithColors(Color... colors) { Color[] newColorArray = new Color[colors.length + 1]; newColorArray[0] = this; System.arraycopy(colors, 0, newColorArray, 1, colors.length); return mixColors(newColorArray); }
/** * Similar to {@link #mixWithColors(Color...)}, mixes the * provided {@link DyeColor}s with this {@link Color}. * * @param dyeColors The dye colors to mix * @return The new color */ public Color mixWithDyes(DyeColor... dyeColors) { Color[] newColorArray = new Color[dyeColors.length + 1]; newColorArray[0] = this; for (int i = 0; i < dyeColors.length; i++) { newColorArray[i + 1] = dyeColors[i].getColor(); } return mixColors(newColorArray); }
/** * Creates a new {@link Color} combining the provided {@link DyeColor} * objects. Since {@link DyeColor}s can be converted into {@link Color} * objects themselves, their summation and average is taken into effect * to properly mix the colors together. * * @param colors The colors to mix * @return The final output mixed color */ public static Color mixDyeColors(DyeColor... colors) { Validate.noNullElements(colors, "No nulls allowed!"); final Color[] actualColors = new Color[colors.length]; for (int i = 0; i < colors.length; i++) { actualColors[i] = colors[i].getColor(); } return mixColors(actualColors); }
public Color mixWithColors(Color... colors) { Color[] newColorArray = new Color[colors.length + 1]; newColorArray[0] = this; System.arraycopy(colors, 0, newColorArray, 1, colors.length); return mixColors(newColorArray); }
public Color mixWithDyes(DyeColor... dyeColors) { Color[] newColorArray = new Color[dyeColors.length + 1]; newColorArray[0] = this; for (int i = 0; i < dyeColors.length; i++) { newColorArray[i + 1] = dyeColors[i].getColor(); } return mixColors(newColorArray); }
public static Color mixDyeColors(DyeColor... colors) { Validate.noNullElements(colors, "No nulls allowed!"); final Color[] actualColors = new Color[colors.length]; for (int i = 0; i < colors.length; i++) { actualColors[i] = colors[i].getColor(); } return mixColors(actualColors); }