public static LGradation GetInstance(LColor s, LColor e, int w, int h, int alpha) { if (gradations == null) { gradations = new Dictionary<string, LGradation>(10); } int hashCode = 1; hashCode = LSystem.Unite(hashCode, s.GetRGB()); hashCode = LSystem.Unite(hashCode, e.GetRGB()); hashCode = LSystem.Unite(hashCode, w); hashCode = LSystem.Unite(hashCode, h); hashCode = LSystem.Unite(hashCode, alpha); string key = Convert.ToString(hashCode); LGradation o = (LGradation) CollectionUtils.Get(gradations,key); if (o == null) { CollectionUtils.Put(gradations,key, o = new LGradation(s, e, w, h, alpha)); } return o; }
public static LGradation GetInstance(Color s, Color e, int w, int h, int alpha) { if (gradations == null) { gradations = new Dictionary <String, LGradation>(10); } int hashCode = 1; hashCode = LSystem.Unite(hashCode, s.PackedValue); hashCode = LSystem.Unite(hashCode, e.PackedValue); hashCode = LSystem.Unite(hashCode, w); hashCode = LSystem.Unite(hashCode, h); hashCode = LSystem.Unite(hashCode, alpha); String key = "" + (hashCode); LGradation o = (LGradation)CollectionUtils.Get(gradations, key); if (o == null) { CollectionUtils.Put(gradations, key, o = new LGradation(s, e, w, h, alpha)); } return(o); }
public static LGradation GetInstance(LColor s, LColor e, int w, int h, int alpha) { if (gradations == null) { gradations = new Dictionary <string, LGradation>(10); } int hashCode = 1; hashCode = LSystem.Unite(hashCode, s.GetRGB()); hashCode = LSystem.Unite(hashCode, e.GetRGB()); hashCode = LSystem.Unite(hashCode, w); hashCode = LSystem.Unite(hashCode, h); hashCode = LSystem.Unite(hashCode, alpha); string key = Convert.ToString(hashCode); LGradation o = (LGradation)CollectionUtils.Get(gradations, key); if (o == null) { CollectionUtils.Put(gradations, key, o = new LGradation(s, e, w, h, alpha)); } return(o); }
public static LGradation GetInstance(Color s, Color e, int w, int h, int alpha) { if (gradations == null) { gradations = new Dictionary<String, LGradation>(10); } int hashCode = 1; hashCode = LSystem.Unite(hashCode, s.PackedValue); hashCode = LSystem.Unite(hashCode, e.PackedValue); hashCode = LSystem.Unite(hashCode, w); hashCode = LSystem.Unite(hashCode, h); hashCode = LSystem.Unite(hashCode, alpha); String key = "" + (hashCode); LGradation o = (LGradation)CollectionUtils.Get(gradations, key); if (o == null) { CollectionUtils.Put(gradations, key, o = new LGradation(s, e, w, h, alpha)); } return o; }