Пример #1
0
    /// <summary>
    /// Returns a color if horizontal and vertical share the same color
    /// Otherwise returns Color.white
    /// </summary>
    public ColorName GetSpaceColor()
    {
        List <MyColor> colors = GetColors();

        if (colors.Count == 0)
        {
            return(ColorName.NONE);
        }

        while (colors.Count > 1)
        {
            MyColor a = colors[0];
            MyColor b = colors[1];
            colors.Remove(a);
            colors.Remove(b);

            MyColor newColor = MyColor.Mix(a.GetColorName(), b.GetColorName());
            colors.Add(newColor);
        }

        return(colors[0].GetColorName());
    }