Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Color MultColorLerp(float t, params Color[] colors) {
- if(colors.Length < 2)
- throw new System.ArgumentException("Need at least 2 colors");
- if(t < 0f)
- return colors[0];
- else if(t >= 1f)
- return colors[colors.Length - 1];
- var i = (int)(t * (colors.Length - 1));
- return Color.Lerp(colors[i++], colors[i], Mathf.Repeat(t * (colors.Length - 1f), 1f));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement