Add methods to modify each channel (RGBA) that return 'this'.

master
jayfella 5 years ago
parent a057a6d74d
commit 37f1e7fabe
  1. 40
      jme3-core/src/main/java/com/jme3/math/ColorRGBA.java

@ -204,6 +204,46 @@ public final class ColorRGBA implements Savable, Cloneable, java.io.Serializable
return this;
}
/**
* Sets the red color to the specified value.
* @param value the value to set the red channel.
* @return the ColorRGBA object with the modified value.
*/
public ColorRGBA setRed(float value) {
r = value;
return this;
}
/**
* Sets the green color to the specified value.
* @param value the value to set the green channel.
* @return the ColorRGBA object with the modified value.
*/
public ColorRGBA setGreen(float value) {
g = value;
return this;
}
/**
* Sets the blue color to the specified value.
* @param value the value to set the blue channel.
* @return the ColorRGBA object with the modified value.
*/
public ColorRGBA setBlue(float value) {
b = value;
return this;
}
/**
* Sets the alpha color to the specified value.
* @param value the value to set the alpha channel.
* @return the ColorRGBA object with the modified value.
*/
public ColorRGBA setAlpha(float value) {
a = value;
return this;
}
/**
* Saturate that color ensuring all channels have a value between 0 and 1
*/

Loading…
Cancel
Save