Upload files to "src/openonyx/render/group_d"

This commit is contained in:
winterflyt committed 2026-11-30 06:08:48 +02:00
1 parent 76e375fd62
commit 8c3a0a5645
4 files changed
+278

No files matched your search

@@ -0,0 +1,93 @@
package openonyx.render.group_d;
public final class Animation {
private float elapsed;
private Easing easing = Easings.EASING6;
private float duration;
private float target;
private float start;
public Animation animateTo(float f, float g, Easing easing) {
if (f == this.target) {
return this;
}
this.start = this.getValue();
this.target = f;
this.duration = Math.max(g, 0.0F);
this.easing = easingx;
this.elapsed = 0.0F;
return this;
}
public static String decrypt(String string) {
String string1 = string;
int n = (--3 ^ 5) << 4 ^ 2 << 2 ^ 1;
String string2;
int p = (string2 = string1).length();
char[] e = new char[p];
boolean bl = true;
int j;
int o = j = p - 1;
char[] c = e;
byte b = 116;
byte d = 95;
int k = o;
int i = n;
while (k >= 0) {
int l = j;
int m = string2.charAt(j);
j--;
c[l] = (char)(m ^ i);
if (j < 0) {
break;
}
m = j--;
c[m] = (char)(string2.charAt(m) ^ b);
k = j;
}
return new String(c);
}
public float getTarget() {
return this.target;
}
public boolean isFinished() {
return this.duration <= 0.0F || this.elapsed >= this.duration;
}
public void update(float f) {
if (!this.isFinished()) {
this.elapsed = Math.min(this.elapsed + f, this.duration);
}
}
public float getValue() {
Animation animation1 = this;
if (animation1.duration <= 0.0F) {
return animation1.target;
}
float f = (float)animation1.easing.apply(animation1.elapsed / animation1.duration);
return animation1.start + (animation1.target - animation1.start) * f;
}
public Animation(float f) {
this.start = f;
this.target = f;
this.duration = 0.0F;
this.elapsed = 0.0F;
}
public Animation set(float f) {
this.start = f;
this.target = f;
this.duration = 0.0F;
this.elapsed = 0.0F;
return this;
}
}
@@ -0,0 +1,97 @@
package openonyx.render.group_d;
import openonyx.theme.internal.ColorUtils;
public final class ColorAnimation {
private int f;
private int H;
private final Animation animation = new Animation(1.0F);
public ColorAnimation L(int i, float f, Easing easing) {
if (i == this.f) {
return this;
}
this.H = this.L();
this.f = i;
this.animation.set(0.0F).animateTo(1.0F, fx, easing);
return this;
}
public void L(float f) {
this.animation.update(fx);
}
public static String decrypt(String string) {
String string1 = string;
int n = --5 << 3 ^ 7;
String string2;
int p = (string2 = string1).length();
char[] e = new char[p];
boolean bl = true;
int j;
int o = j = p - 1;
char[] c = e;
byte b = 22;
byte d = 53;
int k = o;
int i = n;
while (k >= 0) {
int l = j;
int m = string2.charAt(j);
j--;
c[l] = (char)(m ^ i);
if (j < 0) {
break;
}
m = j--;
c[m] = (char)(string2.charAt(m) ^ b);
k = j;
}
return new String(c);
}
public ColorAnimation(int i) {
this.H = i;
this.f = i;
}
private static double[] L(int i) {
double[] d = new double[3];
boolean bl = true;
d[0] = ColorUtils.linearized(ColorUtils.red(i));
d[1] = ColorUtils.linearized(ColorUtils.green(i));
d[2] = ColorUtils.linearized(ColorUtils.blue(i));
return d;
}
public static int L(int i, int j, float f) {
int k = i;
double[] e = L(k);
double[] d = L(j);
int l = ColorUtils.delinearized(e[0] + (d[0] - e[0]) * fx);
int m = ColorUtils.delinearized(e[1] + (d[1] - e[1]) * fx);
i = ColorUtils.delinearized(e[2] + (d[2] - e[2]) * fx);
return ColorUtils.argb(Math.round(ColorUtils.alpha(k) + (ColorUtils.alpha(j) - ColorUtils.alpha(k)) * fx), l, m, i);
}
public int L() {
ColorAnimation colorAnimation1 = this;
float fx;
if ((fx = colorAnimation1.animation.getValue()) <= 0.0F) {
return colorAnimation1.H;
} else {
return fx >= 1.0F ? colorAnimation1.f : L(colorAnimation1.H, colorAnimation1.f, fx);
}
}
public ColorAnimation L(int i) {
this.H = i;
this.f = i;
this.animation.set(1.0F);
return this;
}
}
+6
View File
@@ -0,0 +1,6 @@
package openonyx.render.group_d;
@FunctionalInterface
public interface Easing {
double apply(double d);
}
+82
View File
@@ -0,0 +1,82 @@
package openonyx.render.group_d;
public final class Easings {
public static final Easing EASING = L(0.3, 0.0, 0.8, 0.15);
public static final Easing EASING2 = L(0.2, 0.0, 0.0, 1.0);
public static final Easing EASING3 = L(0.4, 0.0, 0.2, 1.0);
public static final Easing EASING4 = L(0.3, 0.0, 1.0, 1.0);
public static final Easing EASING5 = L(0.0, 0.0, 0.0, 1.0);
public static final Easing EASING6 = L(0.2, 0.0, 0.0, 1.0);
public static final Easing EASING7 = L(0.05, 0.7, 0.1, 1.0);
public static final Easing EASING8 = d -> d;
private static double D(double d, double e, double f) {
double g = d;
int i;
for (int p = i = 0; p < 8; p = i) {
double h;
if (Math.abs(h = L(g, e, f) - d) < 1.0E-6) {
return g;
}
double k;
if (Math.abs(k = d(g, e, f)) < 1.0E-6) {
break;
}
i++;
g -= h / k;
}
double n = 0.0;
double j = 1.0;
g = d;
for (double o = n; o < j; o = n) {
double l;
if (Math.abs((l = L(g, e, f)) - d) < 1.0E-6) {
return g;
}
if (l < d) {
o = n = g;
} else {
j = g;
o = n;
}
double m;
if (Math.abs((m = (o + j) / 2.0) - g) < 1.0E-9) {
return g;
}
g = m;
}
return g;
}
private static double d(double d, double e, double f) {
double g = 1.0 - d;
return 3.0 * g * g * e + 6.0 * g * d * (f - e) + 3.0 * d * d * (1.0 - f);
}
private static double L(double d, double e, double f) {
double g = 1.0 - d;
return 3.0 * g * g * d * e + 3.0 * g * d * d * f + d * d * d;
}
private Easings() {
}
public static Easing L(double d, double e, double f, double g) {
return h -> {
if (h <= 0.0) {
return 0.0;
} else {
return h >= 1.0 ? 1.0 : L(D(h, d, f), e, g);
}
};
}
}