diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt index 36263195d..d1962d140 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt @@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.utils import java.awt.Color import kotlin.math.max - object ColorUtils { /** transfer string colors from the config to java.awt.Color */ @@ -30,4 +29,8 @@ object ColorUtils { alpha ) } + + fun Color.withAlpha(alpha: Int): Int = (alpha.coerceIn(0, 255) shl 24) or (this.rgb and 0x00ffffff) } + + |