Bring back linear interpolation of rgbacolor

This commit is contained in:
DBotThePony 2024-02-03 20:42:19 +07:00
parent e7c0a30d2d
commit 292d81af98
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ kotlin.code.style=official
specifyKotlinAsDependency=false specifyKotlinAsDependency=false
projectGroup=ru.dbotthepony.kommons projectGroup=ru.dbotthepony.kommons
projectVersion=1.7.1 projectVersion=1.7.2
guavaDepVersion=33.0.0 guavaDepVersion=33.0.0
gsonDepVersion=2.8.9 gsonDepVersion=2.8.9

View File

@ -150,14 +150,14 @@ class RGBAColor(red: Float, green: Float, blue: Float, alpha: Float = 1f) : IStr
return red.hashCode() + green.hashCode() * 31 + blue.hashCode() * 31 * 31 + alpha.hashCode() * 31 * 31 * 31 return red.hashCode() + green.hashCode() * 31 + blue.hashCode() * 31 * 31 + alpha.hashCode() * 31 * 31 * 31
} }
/*fun linearInterpolation(t: Float, other: RGBAColor, interpolateAlpha: Boolean = true): RGBAColor { fun linearInterpolation(t: Float, other: RGBAColor, interpolateAlpha: Boolean = true): RGBAColor {
return RGBAColor( return RGBAColor(
linearInterpolation(t, red, other.red), linearInterpolation(t, red, other.red),
linearInterpolation(t, green, other.green), linearInterpolation(t, green, other.green),
linearInterpolation(t, blue, other.blue), linearInterpolation(t, blue, other.blue),
if (interpolateAlpha) linearInterpolation(t, alpha, other.alpha) else alpha, if (interpolateAlpha) linearInterpolation(t, alpha, other.alpha) else alpha,
) )
}*/ }
operator fun times(other: RGBAColor): RGBAColor { operator fun times(other: RGBAColor): RGBAColor {
if (isWhite) if (isWhite)