Fix style

This commit is contained in:
hugeblank 2024-01-19 23:58:29 -08:00
parent d4712f9740
commit 8b94f57ef5
1 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ public int getLightState() {
} else if (primaryLightColour == -1) {
return secondaryLightColour;
} else {
double weight = ((Math.sin(((double)(FrameInfo.getTick() % 41) / 40)*Math.PI*2)+1)/2);
double weight = (Math.sin(((double)(FrameInfo.getTick() % 41) / 40) * Math.PI * 2) + 1) / 2;
return blend(primaryLightColour, secondaryLightColour, weight);
}
}
@ -48,13 +48,13 @@ public int getLightState() {
private static int blend(int a, int b, double weight) {
int[][] rgb = {
{ a >> 16, b >> 16 },
{ a >> 16, b >> 16 },
{ (a & 0x00ff00) >> 8, (b & 0x00ff00) >> 8 },
{ a & 0x0000ff, b & 0x0000ff }
{ a & 0x0000ff, b & 0x0000ff },
};
int[] channels = new int[3];
for (int i = 0; i < 3; i++) {
channels[i] = (int)Math.sqrt(Math.pow(rgb[i][0], 2)*weight + Math.pow(rgb[i][1], 2)*(1-weight));
channels[i] = (int)Math.sqrt(Math.pow(rgb[i][0], 2) * weight + Math.pow(rgb[i][1], 2) * (1 - weight));
}
int color = 0;
for (int channel : channels) {