diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt | 4 |
1 files changed, 3 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 ed0a9740e..1d95413fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt @@ -29,9 +29,11 @@ object ColorUtils { (red * factor).toInt().coerceIn(0, 255), (green * factor).toInt().coerceIn(0, 255), (blue * factor).toInt().coerceIn(0, 255), - alpha + alpha, ) + val TRANSPARENT_COLOR = Color(0, 0, 0, 0) + fun Color.withAlpha(alpha: Int): Int = (alpha.coerceIn(0, 255) shl 24) or (this.rgb and 0x00ffffff) fun Color.addAlpha(alpha: Int): Color = Color(red, green, blue, alpha) |
