private Texture2D GenerateColorTexture(int width)
{
Texture2D textured = new Texture2D(width, 1, TextureFormat.RGBA32, false) {
hideFlags = HideFlags.HideAndDontSave,
wrapMode = TextureWrapMode.Clamp,
hideFlags = HideFlags.DontSave
};
Color[] colors = new Color[width];
for (int i = 0; i < width; i++)
{
colors[i] = this.GetGradientColor(((float) i) / ((float) (width - 1)));
}
textured.SetPixels(colors);
textured.Apply();
return textured;
}