Esempio n. 1
0
        private void RegenerateSVTexture()
        {
            double h = picker != null ? picker.H * 360 : 0;

            if (image.texture != null)
            {
                DestroyImmediate(image.texture);
            }

            Texture2D texture = new Texture2D(100, 100)
            {
                hideFlags = HideFlags.DontSave
            };

            for (int s = 0; s < 100; s++)
            {
                Color32[] colors = new Color32[100];
                for (int v = 0; v < 100; v++)
                {
                    colors[v] = HSVUtil.ConvertHsvToRgb(h, (float)s / 100, (float)v / 100, 1);
                }
                texture.SetPixels32(s, 0, 1, 100, colors);
            }
            texture.Apply();

            image.texture = texture;
        }
Esempio n. 2
0
        private void HSVChanged()
        {
            Color color = HSVUtil.ConvertHsvToRgb(_hue * 360, _saturation, _brightness, _alpha);

            _red   = color.r;
            _green = color.g;
            _blue  = color.b;
        }
Esempio n. 3
0
 protected virtual void HSVChanged(float h, float s, float v)
 {
     createPresetImage.color = HSVUtil.ConvertHsvToRgb(h * 360, s, v, 1);
     //Debug.Log("hsv util color: " + createPresetImage.color);
 }