Beispiel #1
0
        private static void Init()
        {
            displayPicker = new Texture2D(textureWidth, textureHeight, TextureFormat.ARGB32, false);
            for (int i = 0; i < textureWidth; i++)
            {
                for (int j = 0; j < textureHeight; j++)
                {
                    displayPicker.SetPixel(i, j, MuUtils.HSVtoRGB((360f / textureWidth) * i, (1.0f / j) * textureHeight, 1.0f, 1f));
                }
            }
            displayPicker.Apply();

            float v    = 0.0F;
            float diff = 1.0f / textureHeight;

            saturationTexture = new Texture2D(20, textureHeight);
            for (int i = 0; i < saturationTexture.width; i++)
            {
                for (int j = 0; j < saturationTexture.height; j++)
                {
                    saturationTexture.SetPixel(i, j, new Color(v, v, v));
                    v += diff;
                }
                v = 0.0F;
            }
            saturationTexture.Apply();
        }