示例#1
0
    public int CompareTo(ColorFrugal other)
    {
        if (other == null)
        {
            return(1);
        }

        //Return the difference in power.
        return(this.a - other.a);
    }
示例#2
0
    public static Color[] GetMainColorsFromTexture2(Texture2D texture, int min_pixels_per_color)
    {
        Color32[] colors = texture.GetPixels32();
        Debug.Log("Found Total colors:" + colors.Length);
        ColorFrugal[] sArray = new ColorFrugal[colors.Length];
        for (int j = 0; j < colors.Length; ++j)
        {
            sArray[j] = new ColorFrugal(colors[j].r, colors[j].g, colors[j].b, colors[j].a);
        }

        return(GetHistogram2(colors, min_pixels_per_color));
    }
示例#3
0
    public int CompareTo(object obj)
    {
        ColorFrugal other = (ColorFrugal)obj;

        if (other == null)
        {
            return(1);
        }

        //Return the difference in power.
        return(this.a - other.a);
    }
示例#4
0
 public bool Equals(ColorFrugal c)
 {
     return(c.r.Equals(r) && c.g.Equals(g) && c.b.Equals(b) && c.a.Equals(a));
 }