private void ExecuteColorize(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "alpha")
arguments["alpha"] = Variables.GetValue<Percentage>(attribute);
else if (attribute.Name == "alphaBlue")
arguments["alphaBlue"] = Variables.GetValue<Percentage>(attribute);
else if (attribute.Name == "alphaGreen")
arguments["alphaGreen"] = Variables.GetValue<Percentage>(attribute);
else if (attribute.Name == "alphaRed")
arguments["alphaRed"] = Variables.GetValue<Percentage>(attribute);
else if (attribute.Name == "color")
arguments["color"] = Variables.GetValue<MagickColor>(attribute);
}
if (OnlyContains(arguments, "color", "alpha"))
image.Colorize((MagickColor)arguments["color"], (Percentage)arguments["alpha"]);
else if (OnlyContains(arguments, "color", "alphaRed", "alphaGreen", "alphaBlue"))
image.Colorize((MagickColor)arguments["color"], (Percentage)arguments["alphaRed"], (Percentage)arguments["alphaGreen"], (Percentage)arguments["alphaBlue"]);
else
throw new ArgumentException("Invalid argument combination for 'colorize', allowed combinations are: [color, alpha] [color, alphaRed, alphaGreen, alphaBlue]");
}
private void ExecuteComposite(XmlElement element, MagickImage image)