Skip to content

Commit 9d8803a

Browse files
committed
Spotless -> Color
1 parent 9d432d2 commit 9d8803a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main/java/com/chaos131/util/Color.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public enum Color {
3737
this(new Color8Bit(r, g, b));
3838
}
3939

40-
/** Forms a Color out of a Color8BIt */
40+
/** Forms a Color out of a Color8BIt */
4141
Color(Color8Bit c) {
4242
color8Bit = c;
4343
red = c.red;
@@ -47,6 +47,7 @@ public enum Color {
4747

4848
/**
4949
* Returns a COlor8Bit that shows scaled values for the duty cycle
50+
*
5051
* @param dutyCycle a percentage value [-1.0, 1.0] to convert to a scaled color
5152
*/
5253
public static Color8Bit fromDutyCycle(double dutyCycle) {
@@ -59,8 +60,12 @@ public static Color8Bit fromDutyCycle(double dutyCycle) {
5960
int scaleValue = (int) Math.floor(100 * dutyCycle);
6061
int scaledUpValue = grayBase + scaleValue + 10;
6162
int scaledDownValue = grayBase - scaleValue - 10;
62-
return dutyCycle > 0
63-
? new Color8Bit(scaledDownValue, scaledUpValue, scaledDownValue) // Show a scaled green value if positive
64-
: new Color8Bit(scaledUpValue, scaledDownValue, scaledDownValue); // Show a scaled red value if negatve
63+
return dutyCycle > 0
64+
? new Color8Bit(
65+
scaledDownValue,
66+
scaledUpValue,
67+
scaledDownValue) // Show a scaled green value if positive
68+
: new Color8Bit(
69+
scaledUpValue, scaledDownValue, scaledDownValue); // Show a scaled red value if negatve
6570
}
6671
}

0 commit comments

Comments
 (0)