Skip to content

Instantly share code, notes, and snippets.

@greenboxal
Created February 13, 2013 04:38
Show Gist options
  • Save greenboxal/4942310 to your computer and use it in GitHub Desktop.
Save greenboxal/4942310 to your computer and use it in GitHub Desktop.
private bool CheckThreshold(Vector4[] colors, out Vector4 average)
{
int i;
Vector4 a = new Vector4();
Vector4 min = new Vector4(1);
Vector4 max = new Vector4(0);
for (i = 0; i < colors.Length; i++)
{
Vector4 c = colors[i];
Vector4.Min(ref min, ref c, out min);
Vector4.Max(ref max, ref c, out max);
a += c;
}
a /= i;
average = a;
return ((a - _nodeThreshold) <= min && min <= a) || (a >= max && max >= (a + _nodeThreshold));
}
@lMooka
Copy link

lMooka commented Feb 13, 2013

HUE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment