From e7c0a30d2d4a6690f734f2b4d6c54818963b1533 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 3 Feb 2024 20:37:16 +0700 Subject: [PATCH] RGBAColor.times with float --- gradle.properties | 2 +- src/main/kotlin/ru/dbotthepony/kommons/math/RGBAColor.kt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d9c01c5..dabc70e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=1.7.0 +projectVersion=1.7.1 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 1386073..7e97908 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/math/RGBAColor.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/math/RGBAColor.kt @@ -168,6 +168,10 @@ class RGBAColor(red: Float, green: Float, blue: Float, alpha: Float = 1f) : IStr return RGBAColor(red * other.red, green * other.green, blue * other.blue, alpha * other.alpha) } + operator fun times(other: Float): RGBAColor { + return RGBAColor(red * other, green * other, blue * other, alpha) + } + @Suppress("unused") companion object { private val comparator = Comparator