/** * @return the string representation of this color. */ @Override public String toString() { return "com.ardor3d.math.ColorRGBA [R=" + getRed() + ", G=" + getGreen() + ", B=" + getBlue() + ", A=" + getAlpha() + "]"; }
/** * @return the string representation of this color. */ @Override public String toString() { return "com.ardor3d.math.ColorRGBA [R=" + getRed() + ", G=" + getGreen() + ", B=" + getBlue() + ", A=" + getAlpha() + "]"; }
private static void applyFogColor(final ReadOnlyColorRGBA color, final FogStateRecord record) { if (!record.isValid() || !color.equals(record.fogColor)) { record.fogColor.set(color); record.colorBuff.clear(); record.colorBuff.put(record.fogColor.getRed()).put(record.fogColor.getGreen()) .put(record.fogColor.getBlue()).put(record.fogColor.getAlpha()); record.colorBuff.flip(); GL11.glFog(GL11.GL_FOG_COLOR, record.colorBuff); } }
private static void applyFogColor(final ReadOnlyColorRGBA color, final FogStateRecord record) { final GL gl = GLContext.getCurrentGL(); if (!record.isValid() || !color.equals(record.fogColor)) { record.fogColor.set(color); record.colorBuff.clear(); record.colorBuff.put(record.fogColor.getRed()).put(record.fogColor.getGreen()) .put(record.fogColor.getBlue()).put(record.fogColor.getAlpha()); record.colorBuff.flip(); gl.getGL2ES1().glFogfv(GL2ES1.GL_FOG_COLOR, record.colorBuff); } }
/** * Increments the values of this color with the given r, g, b and a values. * * @param r * @param g * @param b * @param a * @return this color for chaining */ public ColorRGBA addLocal(final float r, final float g, final float b, final float a) { return set(getRed() + r, getGreen() + g, getBlue() + b, getAlpha() + a); }
/** * Increments the values of this color with the given r, g, b and a values. * * @param r * @param g * @param b * @param a * @return this color for chaining */ public ColorRGBA addLocal(final float r, final float g, final float b, final float a) { return set(getRed() + r, getGreen() + g, getBlue() + b, getAlpha() + a); }
/** * Internally modifies the values of this color by multiplying them each by the given scalar value. * * @param scalar * @return this color for chaining * * . */ public ColorRGBA multiplyLocal(final float scalar) { return set(getRed() * scalar, getGreen() * scalar, getBlue() * scalar, getAlpha() * scalar); }
/** * Internally modifies the values of this color by multiplying them each by the given scalar value. * * @param scalar * @return this color for chaining * * . */ public ColorRGBA multiplyLocal(final float scalar) { return set(getRed() * scalar, getGreen() * scalar, getBlue() * scalar, getAlpha() * scalar); }
/** * Internally modifies the values of this color by dividing them each by the given scalar value. * * @param scalar * @return this color for chaining * @throws ArithmeticException * if scalar is 0 */ public ColorRGBA divideLocal(final float scalar) { final float invScalar = 1.0f / scalar; return set(getRed() * invScalar, getGreen() * invScalar, getBlue() * invScalar, getAlpha() * invScalar); }
/** * Decrements the values of this color by the given r, g, b and a values. * * @param r * @param g * @param b * @param a * @return this color for chaining */ public ColorRGBA subtractLocal(final float r, final float g, final float b, final float a) { return set(getRed() - r, getGreen() - g, getBlue() - b, getAlpha() - a); }
/** * Internally modifies the values of this color by dividing them each by the given scalar value. * * @param scalar * @return this color for chaining * @throws ArithmeticException * if scalar is 0 */ public ColorRGBA divideLocal(final float scalar) { final float invScalar = 1.0f / scalar; return set(getRed() * invScalar, getGreen() * invScalar, getBlue() * invScalar, getAlpha() * invScalar); }
@Override public void textAlphaChanged(final BMText text, final float alpha) { setDefaultColor(_tintColor.getRed(), _tintColor.getGreen(), _tintColor.getBlue(), _tintColor.getAlpha() * alpha); }
public void setBackgroundColor(final ReadOnlyColorRGBA color) { _backgroundColor.set(color); GL11.glClearColor(_backgroundColor.getRed(), _backgroundColor.getGreen(), _backgroundColor.getBlue(), _backgroundColor.getAlpha()); }
@Override public void setBackgroundColor(final ReadOnlyColorRGBA color) { _backgroundColor.set(color); GL11C.glClearColor(_backgroundColor.getRed(), _backgroundColor.getGreen(), _backgroundColor.getBlue(), _backgroundColor.getAlpha()); }
@Override public void write(final OutputCapsule capsule) throws IOException { capsule.write(getRed(), "r", 1); capsule.write(getGreen(), "g", 1); capsule.write(getBlue(), "b", 1); capsule.write(getAlpha(), "a", 1); }
@Override public void write(final OutputCapsule capsule) throws IOException { capsule.write(getRed(), "r", 1); capsule.write(getGreen(), "g", 1); capsule.write(getBlue(), "b", 1); capsule.write(getAlpha(), "a", 1); }
/** * Internally modifies the values of this color by dividing them each by the given scale values. * * @param scale * @return this color for chaining */ public ColorRGBA divideLocal(final ReadOnlyColorRGBA scale) { return set(getRed() / scale.getRed(), getGreen() / scale.getGreen(), getBlue() / scale.getBlue(), getAlpha() / scale.getAlpha()); }
/** * Internally modifies the values of this color by dividing them each by the given scale values. * * @param scale * @return this color for chaining */ public ColorRGBA divideLocal(final ReadOnlyColorRGBA scale) { return set(getRed() / scale.getRed(), getGreen() / scale.getGreen(), getBlue() / scale.getBlue(), getAlpha() / scale.getAlpha()); }
/** * Internally modifies the values of this color by multiplying them each by the given scale values. * * @param scale * @return this color for chaining */ public ColorRGBA multiplyLocal(final ReadOnlyColorRGBA scale) { return set(getRed() * scale.getRed(), getGreen() * scale.getGreen(), getBlue() * scale.getBlue(), getAlpha() * scale.getAlpha()); }
@Test public void test() { final ColorRGBA clr1 = new ColorRGBA(); assertTrue(1f == clr1.getRed()); assertTrue(1f == clr1.getGreen()); assertTrue(1f == clr1.getBlue()); assertTrue(1f == clr1.getAlpha()); }