public static void DrawGradientWithBackground(Rect position, Texture2D gradientTexture)
{
Rect rect = new Rect(position.x + 1f, position.y + 1f, position.width - 2f, position.height - 2f);
Texture2D backgroundTexture = GetBackgroundTexture();
Rect texCoords = new Rect(0f, 0f, rect.width / ((float) backgroundTexture.width), rect.height / ((float) backgroundTexture.height));
GUI.DrawTextureWithTexCoords(rect, backgroundTexture, texCoords, false);
if (gradientTexture != null)
{
GUI.DrawTexture(rect, gradientTexture, ScaleMode.StretchToFill, true);
}
GUI.Label(position, GUIContent.none, EditorStyles.colorPickerBox);
}