diff options
author | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-10-13 22:51:23 -0700 |
---|---|---|
committer | Anthony Hilyard <anthony.hilyard@gmail.com> | 2021-10-13 22:51:23 -0700 |
commit | 407a3cfabed3869b38527153e8b3322a824f1263 (patch) | |
tree | 06909dc024d048e999354a0c7102a57bccf32ef8 /src/main/java/com/anthonyhilyard/iceberg/util/Easing.java | |
parent | 0eb0e8504684ad9e7bdae99a54de618809cee8d4 (diff) | |
download | Iceberg-407a3cfabed3869b38527153e8b3322a824f1263.tar.gz Iceberg-407a3cfabed3869b38527153e8b3322a824f1263.tar.bz2 Iceberg-407a3cfabed3869b38527153e8b3322a824f1263.zip |
Initial commit for 1.17.1 version.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/util/Easing.java')
-rw-r--r-- | src/main/java/com/anthonyhilyard/iceberg/util/Easing.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/util/Easing.java b/src/main/java/com/anthonyhilyard/iceberg/util/Easing.java index 4146900..bc4e39b 100644 --- a/src/main/java/com/anthonyhilyard/iceberg/util/Easing.java +++ b/src/main/java/com/anthonyhilyard/iceberg/util/Easing.java @@ -1,6 +1,6 @@ package com.anthonyhilyard.iceberg.util; -import net.minecraft.util.text.Color; +import net.minecraft.network.chat.TextColor; /** * Helper functions for smooth easing/interpolation. If you need linear, use net.minecraft.util.math.MathHelper.lerp instead. @@ -32,14 +32,14 @@ public final class Easing return Ease(a, b, t, type, EasingDirection.InOut); } - public static Color Ease(Color a, Color b, float t, EasingType type) + public static TextColor Ease(TextColor a, TextColor b, float t, EasingType type) { - // Helper function to ease between colors. + // Helper function to ease between TextColors. // Ease each component individually. int aV = a.getValue(), bV = b.getValue(); int aA = (aV >> 24) & 0xFF, aR = (aV >> 16) & 0xFF, aG = (aV >> 8) & 0xFF, aB = (aV >> 0) & 0xFF, bA = (bV >> 24) & 0xFF, bR = (bV >> 16) & 0xFF, bG = (bV >> 8) & 0xFF, bB = (bV >> 0) & 0xFF; - return Color.fromRgb((int)Ease(aA, bA, t, type) << 24 | + return TextColor.fromRgb((int)Ease(aA, bA, t, type) << 24 | (int)Ease(aR, bR, t, type) << 16 | (int)Ease(aG, bG, t, type) << 8 | (int)Ease(aB, bB, t, type) << 0); |