Four51.CmykColor

jdubs edited this page Oct 21, 2016 · 1 revision

Overview

Constructs a Pageflex.Scripting.Color object and exposes the value for assignment to a defined color in the template file.

Syntax

return new CmykColor("CustomColor_CMYK", "100-80-60-0").ToString();

Source Code

internal class CmykColor
{
	private string _name;
	private string _cmyk;
	public double[] Cmyk
	{
		get
		{
			string[] input = _cmyk.ToString().Split(new string[] { "-" }, StringSplitOptions.None);
			double[] values = { Convert.ToDouble(input[0]), Convert.ToDouble(input[1]), Convert.ToDouble(input[2]), Convert.ToDouble(input[3]) };
			return values;
		}
	}

	public CmykColor(string Name, string Values)
	{
		_name = Name;
		_cmyk = Values;

		//get defined color and apply cmyk values
		Color color = Application.CurrentDocument.GetColor(_name);
		color.CmykValues = this.Cmyk;
	}

	public override string ToString()
	{
		return _name;
	}
}

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.