From 292d81af987f70700068c4154308598005961c24 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 3 Feb 2024 20:42:19 +0700 Subject: [PATCH] Bring back linear interpolation of rgbacolor --- gradle.properties | 2 +- src/main/kotlin/ru/dbotthepony/kommons/math/RGBAColor.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index dabc70e..4f8a40c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=1.7.1 +projectVersion=1.7.2 guavaDepVersion=33.0.0 gsonDepVersion=2.8.9 diff --git a/src/main/kotlin/ru/dbotthepony/kommons/math/RGBAColor.kt b/src/main/kotlin/ru/dbotthepony/kommons/math/RGBAColor.kt index 7e97908..02fbef9 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/math/RGBAColor.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/math/RGBAColor.kt @@ -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 } - /*fun linearInterpolation(t: Float, other: RGBAColor, interpolateAlpha: Boolean = true): RGBAColor { + fun linearInterpolation(t: Float, other: RGBAColor, interpolateAlpha: Boolean = true): RGBAColor { return RGBAColor( linearInterpolation(t, red, other.red), linearInterpolation(t, green, other.green), linearInterpolation(t, blue, other.blue), if (interpolateAlpha) linearInterpolation(t, alpha, other.alpha) else alpha, ) - }*/ + } operator fun times(other: RGBAColor): RGBAColor { if (isWhite)