aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/utils
diff options
context:
space:
mode:
authorRime <81419447+Emirlol@users.noreply.github.com>2024-05-09 21:36:20 +0300
committerRime <81419447+Emirlol@users.noreply.github.com>2024-05-23 13:31:48 +0300
commit9fea533e30fdb5c825a72d2cf560958187764c6f (patch)
tree8dc3ea51a6d3f3f0f8a1d7bccc8fa29edee89c59 /src/main/java/de/hysky/skyblocker/utils
parent16b449cac78f61f935d8754c32317998b1b3014c (diff)
downloadSkyblocker-9fea533e30fdb5c825a72d2cf560958187764c6f.tar.gz
Skyblocker-9fea533e30fdb5c825a72d2cf560958187764c6f.tar.bz2
Skyblocker-9fea533e30fdb5c825a72d2cf560958187764c6f.zip
Egg Finder initial commit
Current issues: - Rendered waypoints do not turn off, can't figure out why - Entity equipment is sent before the chat message for new eggs, creating situations where the "found" message is repeated twice
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/utils')
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/ColorUtils.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/ColorUtils.java b/src/main/java/de/hysky/skyblocker/utils/ColorUtils.java
new file mode 100644
index 00000000..0196edf2
--- /dev/null
+++ b/src/main/java/de/hysky/skyblocker/utils/ColorUtils.java
@@ -0,0 +1,16 @@
+package de.hysky.skyblocker.utils;
+
+public class ColorUtils {
+ /**
+ * Takes an RGB color as an integer and returns an array of the color's components as floats, in RGB format.
+ * @param color The color to get the components of.
+ * @return An array of the color's components as floats.
+ */
+ public static float[] getFloatComponents(int color) {
+ return new float[] {
+ ((color >> 16) & 0xFF) / 255f,
+ ((color >> 8) & 0xFF) / 255f,
+ (color & 0xFF) / 255f
+ };
+ }
+}