How can I pass an array as three arguments to a function in Java? (Forgive me, I'm very new to Java).
I have the following function which takes float r, float g, float b, float a
as arguments.
renderer.prepare(r, g, b, 1);
And I want to pass the output from this function in. (Or figure out how to return three separate unpacked floats).
public static float[] rgbToFloat(int r, int g, int b) {
return new float[] {(float) r / 255f, (float) g / 255f, (float) b / 255f};
}
How can I do this? In some other languages it would look something like this:
renderer.prepare(...rgbToFloat(25, 60, 245), 1);