private ColorRange2D(IEnumerable <Color> colors, IEnumerable <UV> parameters) { var parameterList = parameters as UV[] ?? parameters.ToArray(); var colorList = colors as Color[] ?? colors.ToArray(); quadtree = Quadtree.ByUVs(parameterList); // Store the colors for (int i = 0; i < parameterList.Count(); i++) { Node node; if (quadtree.Root.TryFind(parameterList[i], out node)) { node.Item = colorList[i]; } } indexedColors = colorList.Zip(parameterList, (c, t) => new Color.IndexedColor2D(c, t)).ToList(); }