aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/IntUtil.kt
diff options
context:
space:
mode:
authorJacob <55346310+Kathund@users.noreply.github.com>2025-07-03 20:00:17 +0800
committerGitHub <noreply@github.com>2025-07-03 14:00:17 +0200
commit07464087671ba52aacd71fc6c276460ed77e3612 (patch)
tree21896b32dd8295705f449563c85f87f9fa661b1e /src/main/kotlin/util/IntUtil.kt
parent5147d1b953fc60e1cecea112f56e63e61e25a7d6 (diff)
downloadFirmament-07464087671ba52aacd71fc6c276460ed77e3612.tar.gz
Firmament-07464087671ba52aacd71fc6c276460ed77e3612.tar.bz2
Firmament-07464087671ba52aacd71fc6c276460ed77e3612.zip
feat: transparent block renders
Diffstat (limited to 'src/main/kotlin/util/IntUtil.kt')
-rw-r--r--src/main/kotlin/util/IntUtil.kt12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/kotlin/util/IntUtil.kt b/src/main/kotlin/util/IntUtil.kt
new file mode 100644
index 0000000..2695906
--- /dev/null
+++ b/src/main/kotlin/util/IntUtil.kt
@@ -0,0 +1,12 @@
+package moe.nea.firmament.util
+
+object IntUtil {
+ data class RGBA(val r: Int, val g: Int, val b: Int, val a: Int)
+
+ fun Int.toRGBA(): RGBA {
+ return RGBA(
+ r = (this shr 16) and 0xFF, g = (this shr 8) and 0xFF, b = this and 0xFF, a = (this shr 24) and 0xFF
+ )
+ }
+
+}