aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/util/IntUtil.kt
blob: 2695906f02e42731c107dd4bd6cad5c93d733693 (plain)
1
2
3
4
5
6
7
8
9
10
11
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
		)
	}

}