Esempio n. 1
0
 void PaintPickerHue()
 {
     var tmpTexture = new Texture2D(100, 10);
     for (int y = 0; y < tmpTexture.height; y++)
     {
         for (int x = 0; x < tmpTexture.width; x++)
         {
             Phoenix.HSB96 hsb = new Phoenix.HSB96();
             hsb.H = (float)x / 99 * 360;
             if (hsb.H >= 360)
             {
                 hsb.H = 0;
             }
             hsb.S = 1.0f;
             hsb.B = 1.0f;
             //filling the temporary texture with the target texture
             tmpTexture.SetPixel(x, y, hsb.ToColor());
         }
     }
     tmpTexture.Apply();
     RawImage rawImageHue = transform.GetChild(2).gameObject.GetComponent<RawImage>();
     rawImageHue.texture = tmpTexture;
 }
Esempio n. 2
0
 void PaintPickerSB()
 {
     var tmpTexture = new Texture2D(256, 256);
     for (int y = 0; y < tmpTexture.height; y++)
     {
         for (int x = 0; x < tmpTexture.width; x++)
         {
             Phoenix.HSB96 hsb = new Phoenix.HSB96();
             hsb.H = this.hsb.H;
             hsb.S = (float)x / 255;
             hsb.B = (float)y / 255;
             //filling the temporary texture with the target texture
             tmpTexture.SetPixel(x, y, hsb.ToColor());
         }
     }
     tmpTexture.Apply();
     RawImage rawImageSB = transform.GetChild(1).gameObject.GetComponent<RawImage>();
     rawImageSB.texture = tmpTexture;
 }