Four51.Actions.DefinedColor

jdubs edited this page Oct 21, 2016 · 1 revision

Table of Contents

Overview

Creates a Pageflex.Scripting.Color object and assigns appropriate values based on type.

Syntax

DefinedColor("CustomColor_CMYK", "cmyk", "100-80-60-0");

Source Code

internal static string DefinedColor(object Color, object ColorType, object Definition)
{
	uint val;
	object type;

	bool IsNamed = !(UInt32.TryParse(ColorType.ToString(), out val));
	if (IsNamed)
		type = Enum.Parse(typeof(ColorTypes), (string)ColorType, true);
	else
		type = (ColorTypes)Convert.ToUInt32(ColorType);

	switch ((ColorTypes)type)
	{
		case ColorTypes.Cmyk:
			return new CmykColor((string)Color, (string)Definition).ToString();
		case ColorTypes.Rgb:
			return new RgbColor((string)Color, (string)Definition).ToString();
		case ColorTypes.Name:
			return (string)Color;
		default:
			throw new Four51ActionsException("Color type or definition not valid.");
	}
}

References

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.