Collection of useful utilities for Java games and apps. A lot of interesting utilities that could maybe still find some use if you work with Java...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mightyutils/src/mightypork/utils/math/color/ColorAlphaAdjuster.java

47 lines
609 B

package mightypork.utils.math.color;
import mightypork.utils.math.constraints.num.Num;
public class ColorAlphaAdjuster extends Color {
private final Color source;
private final Num alphaAdjust;
public ColorAlphaAdjuster(Color source, Num alphaMul)
{
this.source = source;
this.alphaAdjust = alphaMul;
}
@Override
public double r()
{
return source.r();
}
@Override
public double g()
{
return source.g();
}
@Override
public double b()
{
return source.b();
}
@Override
protected double rawAlpha()
{
return source.rawAlpha() * alphaAdjust.value();
}
}