/** Subtracts the given color from this color * * @param color the color * @return this color */ public Color sub (Color color) { this.r -= color.r; this.g -= color.g; this.b -= color.b; this.a -= color.a; return clamp(); }
/** Multiplies the this color and the given color * * @param color the color * @return this color. */ public Color mul (Color color) { this.r *= color.r; this.g *= color.g; this.b *= color.b; this.a *= color.a; return clamp(); }
/** Multiplies all components of this Color with the given value. * * @param value the value * @return this color */ public Color mul (float value) { this.r *= value; this.g *= value; this.b *= value; this.a *= value; return clamp(); }
/** Multiplies the this color and the given color * * @param color the color * @return this color. */ public Color mul (Color color) { this.r *= color.r; this.g *= color.g; this.b *= color.b; this.a *= color.a; return clamp(); }
/** Adds the given color to this color. * * @param color the color * @return this color */ public Color add (Color color) { this.r += color.r; this.g += color.g; this.b += color.b; this.a += color.a; return clamp(); }
/** Linearly interpolates between this color and the target color by t which is in the range [0,1]. The result is stored in * this color. * @param target The target color * @param t The interpolation coefficient * @return This color for chaining. */ public Color lerp (final Color target, final float t) { this.r += t * (target.r - this.r); this.g += t * (target.g - this.g); this.b += t * (target.b - this.b); this.a += t * (target.a - this.a); return clamp(); }
/** Subtracts the given color from this color * * @param color the color * @return this color */ public Color sub (Color color) { this.r -= color.r; this.g -= color.g; this.b -= color.b; this.a -= color.a; return clamp(); }
/** Linearly interpolates between this color and the target color by t which is in the range [0,1]. The result is stored in * this color. * @param target The target color * @param t The interpolation coefficient * @return This color for chaining. */ public Color lerp (final Color target, final float t) { this.r += t * (target.r - this.r); this.g += t * (target.g - this.g); this.b += t * (target.b - this.b); this.a += t * (target.a - this.a); return clamp(); }
/** Constructor, sets the components of the color * * @param r the red component * @param g the green component * @param b the blue component * @param a the alpha component */ public Color (float r, float g, float b, float a) { this.r = r; this.g = g; this.b = b; this.a = a; clamp(); }
/** Multiplies all components of this Color with the given value. * * @param value the value * @return this color */ public Color mul (float value) { this.r *= value; this.g *= value; this.b *= value; this.a *= value; return clamp(); }
/** Adds the given color to this color. * * @param color the color * @return this color */ public Color add (Color color) { this.r += color.r; this.g += color.g; this.b += color.b; this.a += color.a; return clamp(); }
/** Constructor, sets the components of the color * * @param r the red component * @param g the green component * @param b the blue component * @param a the alpha component */ public Color (float r, float g, float b, float a) { this.r = r; this.g = g; this.b = b; this.a = a; clamp(); }
/** Adds the given color component values to this Color's values. * * @param r Red component * @param g Green component * @param b Blue component * @param a Alpha component * * @return this Color for chaining */ public Color add (float r, float g, float b, float a) { this.r += r; this.g += g; this.b += b; this.a += a; return clamp(); }
/** Linearly interpolates between this color and the target color by t which is in the range [0,1]. The result is stored in * this color. * @param r The red component of the target color * @param g The green component of the target color * @param b The blue component of the target color * @param a The alpha component of the target color * @param t The interpolation coefficient * @return This color for chaining. */ public Color lerp (final float r, final float g, final float b, final float a, final float t) { this.r += t * (r - this.r); this.g += t * (g - this.g); this.b += t * (b - this.b); this.a += t * (a - this.a); return clamp(); }
/** Subtracts the given values from this Color's component values. * * @param r Red component * @param g Green component * @param b Blue component * @param a Alpha component * * @return this Color for chaining */ public Color sub (float r, float g, float b, float a) { this.r -= r; this.g -= g; this.b -= b; this.a -= a; return clamp(); }
/** Sets this Color's component values. * * @param r Red component * @param g Green component * @param b Blue component * @param a Alpha component * * @return this Color for chaining */ public Color set (float r, float g, float b, float a) { this.r = r; this.g = g; this.b = b; this.a = a; return clamp(); }
/** Linearly interpolates between this color and the target color by t which is in the range [0,1]. The result is stored in * this color. * @param r The red component of the target color * @param g The green component of the target color * @param b The blue component of the target color * @param a The alpha component of the target color * @param t The interpolation coefficient * @return This color for chaining. */ public Color lerp (final float r, final float g, final float b, final float a, final float t) { this.r += t * (r - this.r); this.g += t * (g - this.g); this.b += t * (b - this.b); this.a += t * (a - this.a); return clamp(); }
/** Multiplies this Color's color components by the given ones. * * @param r Red component * @param g Green component * @param b Blue component * @param a Alpha component * * @return this Color for chaining */ public Color mul (float r, float g, float b, float a) { this.r *= r; this.g *= g; this.b *= b; this.a *= a; return clamp(); }
/** Adds the given color component values to this Color's values. * * @param r Red component * @param g Green component * @param b Blue component * @param a Alpha component * * @return this Color for chaining */ public Color add (float r, float g, float b, float a) { this.r += r; this.g += g; this.b += b; this.a += a; return clamp(); }
/** Multiplies this Color's color components by the given ones. * * @param r Red component * @param g Green component * @param b Blue component * @param a Alpha component * * @return this Color for chaining */ public Color mul (float r, float g, float b, float a) { this.r *= r; this.g *= g; this.b *= b; this.a *= a; return clamp(); }