Skip to content

Instantly share code, notes, and snippets.

@TranquilMarmot
Created April 24, 2013 22:19
Show Gist options
  • Save TranquilMarmot/5456079 to your computer and use it in GitHub Desktop.
Save TranquilMarmot/5456079 to your computer and use it in GitHub Desktop.
What in sam hill
public void setColor (float r, float g, float b, float a) {
int intBits = ((int)(255 * a) << 24) | ((int)(255 * b) << 16) | ((int)(255 * g) << 8) | ((int)(255 * r));
float color = NumberUtils.intToFloatColor(intBits);
if (color == this.color) return;
this.color = color;
float[] vertices = this.vertices;
for (int i = 2, n = idx; i < n; i += 5)
vertices[i] = color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment