diff options
author | inglettronald <inglettronald@gmail.com> | 2023-06-12 20:51:33 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-06-12 20:51:33 -0500 |
commit | 2b93c22070564ed3ad31cd1862c65185b79c1a78 (patch) | |
tree | 89909715392a1af4567ec9cdb0584269786d7e5c /src/main/kotlin/com/dulkirfabric/util | |
parent | eea733bdab195e3a68d4f0d8264abddd5ab2ae59 (diff) | |
download | DulkirMod-Fabric-2b93c22070564ed3ad31cd1862c65185b79c1a78.tar.gz DulkirMod-Fabric-2b93c22070564ed3ad31cd1862c65185b79c1a78.tar.bz2 DulkirMod-Fabric-2b93c22070564ed3ad31cd1862c65185b79c1a78.zip |
Added a naive implementation of selected block outlines options
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/util')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/util/ColorUtil.kt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/util/ColorUtil.kt b/src/main/kotlin/com/dulkirfabric/util/ColorUtil.kt new file mode 100644 index 0000000..0a89dbd --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/util/ColorUtil.kt @@ -0,0 +1,21 @@ +package com.dulkirfabric.util + +import java.awt.Color + +object ColorUtil { + private fun getRed (colorInt: Int): Int { + return colorInt shr 16 and 255 + } + + private fun getGreen (colorInt: Int): Int { + return colorInt shr 8 and 255 + } + + private fun getBlue (colorInt: Int): Int { + return colorInt and 255 + } + + fun toRGB (colorInt: Int) : Color { + return Color(getRed(colorInt), getGreen(colorInt), getBlue(colorInt)) + } +}
\ No newline at end of file |