}
}
public Vector4 getColor(float pos) {
Vector4 ret = new Vector4();
if (pos <= entries.firstElement().position) ret.set(entries.firstElement().color);
else if (pos >= entries.lastElement().position) ret.set(entries.lastElement().color);
else {
for (int i = 0; i < entries.size()-1; i++) {
if (entries.get(i+1).position > pos) {
Entry a = entries.get(i);
Entry b = entries.get(i+1);
float interp = (pos-a.position)/(b.position-a.position);
//ret.set(interp);
ret.set(a.color);
ret.mult_ip(1.0f - interp);
ret.mult_add_ip(interp, b.color);
break;
}
}
}