AntTweakBar.Tw.GetColorParam C# (CSharp) Method

GetColorParam() public static method

This function returns the current value of a bar or variable parameter.
public static GetColorParam ( IntPtr bar, String varName, String paramName ) : Color
bar System.IntPtr
varName String
paramName String
return Color
        public static Color GetColorParam(IntPtr bar, String varName, String paramName)
        {
            var components = GetIntParam(bar, varName, paramName);

            if (components.Length != 3) {
                throw new ArgumentException("Parameter is not a color.");
            }

            for (var t = 0; t < 3; ++t) {
                if ((components[t] < 0) || (components[t] > 255)) {
                    throw new ArgumentException("Parameter is not a color.");
                }
            }

            return Color.FromArgb(components[0], components[1], components[2]);
        }