jdubs edited this page Oct 21, 2016 · 1 revision


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


return new RgbColor("CustomColor_RGB", "100-80-60").ToString();

Source Code

internal class RgbColor
	private string _name;
	private string _rgb;
	private uint[] Rgb
			string[] input = _rgb.ToString().Split(new string[] { "-" }, StringSplitOptions.None);
			uint[] values = { Convert.ToUInt32(input[0]), Convert.ToUInt32(input[1]), Convert.ToUInt32(input[2]) };
			return values;

	public RgbColor(string Name, string Values)
		_name = Name;
		_rgb = Values;

		//get defined color and apply rgb values
		Color color = Application.CurrentDocument.GetColor(_name);
		color.RgbValues = this.Rgb;

	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.