Esempio n. 1
0
        private void CreateColorPickerBG()
        {
            if (_colorPickerBG == null)
            {
                _colorPickerBG = new Texture2D(pickerSize, pickerSize);
            }

            float S, V;
            int   w  = pickerSize;
            int   h  = pickerSize;
            float wu = UnitsPerPixel;
            float hu = UnitsPerPixel;

            // HSV colors, H in slider, S horizontal, V vertical.
            for (int x = 0; x < w; x++)
            {
                for (int y = 0; y < h; y++)
                {
                    S = x * wu;
                    V = y * hu;
                    _colorPickerBG.SetPixel(x, y, ColorHelper.HSVtoRGB(H, S, V, A));
                }
            }

            _colorPickerBG.Apply();
        }
Esempio n. 2
0
        public void Notify_HSVUpdated()
        {
            tempColor      = ColorHelper.HSVtoRGB(H, S, V);
            tempColor.a    = A;
            _tempPreviewBG = CreatePreviewBG(tempColor);

            if (_preview)
            {
                _hexOut = _hexIn = ColorHelper.RGBtoHex(tempColor);
            }

            if (_autoApply)
            {
                Apply();
            }
        }
Esempio n. 3
0
        private void CreateHuePickerBG()
        {
            if (_huePickerBG == null)
            {
                _huePickerBG = new Texture2D(1, pickerSize);
            }

            var h  = pickerSize;
            var hu = UnitsPerPixel;

            // HSV colors, S = V = 1
            for (int y = 0; y < h; y++)
            {
                _huePickerBG.SetPixel(0, y, ColorHelper.HSVtoRGB(hu * y, 1f, 1f));
            }
            _huePickerBG.Apply();
        }