示例#1
0
        /// <summary>
        /// Vector from a string.
        /// </summary>
        static public ColorRGB FromString(string s)
        {
            ColorRGB v = new ColorRGB();
            try
            {
                string[] separators = new string[] { "," };
                string[] result = s.Split(separators, StringSplitOptions.None);

                v.r = float.Parse(result[0]);
                v.g = float.Parse(result[1]);
                v.b = float.Parse(result[2]);
            }
            catch { }

            return v;
        }
示例#2
0
 /// <summary>
 /// Are these colors equal.
 /// </summary>
 public bool Equals(ColorRGB v)
 {
     return this == v;
 }