Exemplo n.º 1
0
    private IEnumerator ProminentColorsInUrl(List <string> imgUrls)
    {
        for (int i = 0; i < imgUrls.Count; i++)
        {
            string imgUrl = imgUrls[i];
            WWW    www    = new WWW(imgUrl);

            yield return(www);

            www.LoadImageIntoTexture(mTexture);
            if (mTexture == null || (mTexture.width == 8 && mTexture.height == 8))
            {
                continue;
            }

            Instantiate(elementPrefab, elemenTransformParent)
            .GetComponent <Element>()
            .SetupElement(mTexture,
                          ProminentColor.GetColors32FromImage(mTexture,
                                                              maxColors,
                                                              colorLimiterPercentage,
                                                              uniteColorsTolerance,
                                                              minimiumColorPercentage));
        }
    }
Exemplo n.º 2
0
        public void GetHexColors_InvalidImage_Failed()
        {
            List <string> hexList = null;

            Assert.That(() => hexList = ProminentColor.GetHexColorsFromImage(null,
                                                                             3,
                                                                             85f,
                                                                             5,
                                                                             10f),
                        Throws.TypeOf <System.Exception>());
        }
Exemplo n.º 3
0
        public void GetColors32_InvalidData_Failed()
        {
            List <Color32> colorList = null;

            Assert.That(() => colorList = ProminentColor.GetColors32FromImage(texture2D,
                                                                              0,
                                                                              85f,
                                                                              10000,
                                                                              0f),
                        Throws.TypeOf <System.Exception>());
        }
Exemplo n.º 4
0
        public void GetColors32_InvalidImage_Failed()
        {
            List <Color32> colorList = null;


            Assert.That(() => colorList = ProminentColor.GetColors32FromImage(null,
                                                                              3,
                                                                              85f,
                                                                              5,
                                                                              10f),
                        Throws.TypeOf <System.Exception>());
        }
Exemplo n.º 5
0
        public void GetHexColors_Success()
        {
            List <string> hexList = null;

            hexList = ProminentColor.GetHexColorsFromImage(texture2D,
                                                           3,
                                                           85f,
                                                           5,
                                                           10f);

            Assert.NotNull(hexList);
            Assert.Greater(hexList.Count, 0);
        }
Exemplo n.º 6
0
        public void GetColors32_Success()
        {
            List <Color32> colorList = null;

            colorList = ProminentColor.GetColors32FromImage(texture2D,
                                                            3,
                                                            85f,
                                                            5,
                                                            10f);

            Assert.NotNull(colorList);
            Assert.Greater(colorList.Count, 0);
        }