public static void setInBuffer(ColorRGBA color, FloatBuffer buf, int index) {
        buf.position(index * 4);
        buf.put(color.r);
        buf.put(color.g);
        buf.put(color.b);
        buf.put(color.a);
    }
Sets the data contained in the given color into the FloatBuffer at the
specified index.

@param color
           the data to insert
@param buf
           the buffer to insert into
@param index
           the position to place the data; in terms of colors not floats
jme3-core/src/main/java/com/jme3/util/BufferUtils.java