ColorRGBA implements Cloneable, Savable, Externalizable, ReadOnlyColorRGBA, Poolable { @Override public float[] toArray(float[] store) { if (store == null) { store = new float[4]; } store[3] = getAlpha(); store[2] = getBlue(); store[1] = getGreen(); store[0] = getRed(); return store; } ColorRGBA();  ColorRGBA(final ReadOnlyColorRGBA src);  ColorRGBA(final float r, final float g, final float b, final float a); @Override float getRed(); @Override float getGreen(); @Override float getBlue(); @Override float getAlpha(); @Override float getValue(final int index); void setValue(final int index, final float value); @Override float[] toArray(float[] store); void setRed(final float r); void setGreen(final float g); void setBlue(final float b); void setAlpha(final float a); ColorRGBA set(final float r, final float g, final float b, final float a); ColorRGBA set(final ReadOnlyColorRGBA source); ColorRGBA zero(); @Override ColorRGBA clamp(final ColorRGBA store); ColorRGBA clampLocal(); static ColorRGBA randomColor(final ColorRGBA store); @Override int asIntARGB(); @Override int asIntRGBA(); ColorRGBA fromIntARGB(final int color); ColorRGBA fromIntRGBA(final int color); @Override String asHexRRGGBBAA(); @Override ColorRGBA add(final float r, final float g, final float b, final float a, final ColorRGBA store); ColorRGBA addLocal(final float r, final float g, final float b, final float a); @Override ColorRGBA add(final ReadOnlyColorRGBA source, final ColorRGBA store); ColorRGBA addLocal(final ReadOnlyColorRGBA source); @Override ColorRGBA subtract(final float r, final float g, final float b, final float a, final ColorRGBA store); ColorRGBA subtractLocal(final float r, final float g, final float b, final float a); @Override ColorRGBA subtract(final ReadOnlyColorRGBA source, final ColorRGBA store); ColorRGBA subtractLocal(final ReadOnlyColorRGBA source); @Override ColorRGBA multiply(final float scalar, final ColorRGBA store); ColorRGBA multiplyLocal(final float scalar); @Override ColorRGBA multiply(final ReadOnlyColorRGBA scale, final ColorRGBA store); ColorRGBA multiplyLocal(final ReadOnlyColorRGBA scale); @Override ColorRGBA divide(final float scalar, final ColorRGBA store); ColorRGBA divideLocal(final float scalar); @Override ColorRGBA divide(final ReadOnlyColorRGBA scale, final ColorRGBA store); ColorRGBA divideLocal(final ReadOnlyColorRGBA scale); @Override ColorRGBA lerp(final ReadOnlyColorRGBA endColor, final float scalar, final ColorRGBA store); ColorRGBA lerpLocal(final ReadOnlyColorRGBA endColor, final float scalar); static ColorRGBA lerp(final ReadOnlyColorRGBA beginColor, final ReadOnlyColorRGBA endColor, final float scalar,
      final ColorRGBA store); ColorRGBA lerpLocal(final ReadOnlyColorRGBA beginColor, final ReadOnlyColorRGBA endColor, final float scalar); static boolean isValid(final ReadOnlyColorRGBA color); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object o); @Override ColorRGBA clone(); @Override Class<? extends ColorRGBA> getClassTag(); @Override void write(final OutputCapsule capsule); @Override void read(final InputCapsule capsule); @Override void readExternal(final ObjectInput in); @Override void writeExternal(final ObjectOutput out); final static ColorRGBA fetchTempInstance(); final static void releaseTempInstance(final ColorRGBA color); static ColorRGBA parseColor(final String colorString, final ColorRGBA store); static final ReadOnlyColorRGBA BLACK; static final ReadOnlyColorRGBA BLACK_NO_ALPHA; static final ReadOnlyColorRGBA WHITE; static final ReadOnlyColorRGBA DARK_GRAY; static final ReadOnlyColorRGBA GRAY; static final ReadOnlyColorRGBA LIGHT_GRAY; static final ReadOnlyColorRGBA RED; static final ReadOnlyColorRGBA GREEN; static final ReadOnlyColorRGBA BLUE; static final ReadOnlyColorRGBA YELLOW; static final ReadOnlyColorRGBA MAGENTA; static final ReadOnlyColorRGBA CYAN; static final ReadOnlyColorRGBA ORANGE; static final ReadOnlyColorRGBA BROWN; static final ReadOnlyColorRGBA PINK; }
@Test public void testToArray() { final ColorRGBA clr1 = new ColorRGBA(ColorRGBA.DARK_GRAY); final float[] farray = clr1.toArray(null); final float[] farray2 = clr1.toArray(new float[4]); assertNotNull(farray); assertNotNull(farray2); assertTrue(farray.length == 4); assertTrue(farray[0] == .2f); assertTrue(farray[1] == .2f); assertTrue(farray[2] == .2f); assertTrue(farray[3] == 1f); try { clr1.toArray(new float[1]); fail("toFloatArray(d[1]) should have thrown ArrayIndexOutOfBoundsException."); } catch (final ArrayIndexOutOfBoundsException e) {} }