Skip to content

Four51.Actions.CmykColor

jdubs edited this page Oct 23, 2016 · 1 revision

Table of Contents

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 = { N(input[0]), N(input[1]), N(input[2]), N(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;
	}
}

Referenced Methods

Clone this wiki locally