Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity mix gradient colors

static Color EvaluateColorMix(float relativeX, float relativeY, Gradient horizontal, Gradient vertical)
{
  Color h = horizontal.Evaluate(relativeX);
  Color v = vertical.Evaluate(relativeY);
  return MixColors(h, v);
}

static Color MixColors(Color a, Color b) => (a + b) / 2;
 
PREVIOUS NEXT
Tagged: #unity #mix #gradient #colors
ADD COMMENT
Topic
Name
5+8 =