static public GFill Create(GNFO[] gg) { GFill gf = new GFill(); gf.data = gg; float ar = float.NaN; List <Color> clrs = new List <Color>(); List <float> poz = new List <float>(); if (gf.data[0].P == float.NaN) { ar = 1f / gf.data.Length; } for (int i = 0; i < gf.data.Length; i++) { if (ar == float.NaN) { poz.Add(gf.data[i].P); } else { poz.Add(i * ar); } clrs.Add(gf.data[i].C); } gf.C = clrs.ToArray(); gf.P = poz.ToArray(); gf.blend = new ColorBlend(gf.data.Length); gf.blend.Colors = gf.C; gf.blend.Positions = gf.P; clrs = null; poz = null; return(gf); }
public GFill(GNFO[] gn) { GFill t = Create(gn); this.blend = t.blend; this.C = t.C; this.P = t.P; this.data = t.data; t = null; }