UnityEditor.ColorPresetLibrary.RenderSwatchWithAlpha C# (CSharp) Method

RenderSwatchWithAlpha() private method

private RenderSwatchWithAlpha ( Rect rect, Color preset, Texture2D swatchTexture ) : void
rect UnityEngine.Rect
preset Color
swatchTexture UnityEngine.Texture2D
return void
        private void RenderSwatchWithAlpha(Rect rect, Color preset, Texture2D swatchTexture)
        {
            Rect position = new Rect(rect.x + 1f, rect.y + 1f, rect.width - 2f, rect.height - 2f);
            GUI.color = Color.white;
            Rect texCoords = new Rect(0f, 0f, position.width / ((float) this.m_CheckerBoard.width), position.height / ((float) this.m_CheckerBoard.height));
            GUI.DrawTextureWithTexCoords(position, this.m_CheckerBoard, texCoords, false);
            GUI.color = preset;
            GUI.DrawTexture(rect, EditorGUIUtility.whiteTexture);
            GUI.color = new Color(preset.r, preset.g, preset.b, 1f);
            GUI.DrawTexture(rect, swatchTexture);
        }