File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/main/java/com/chaos131/util Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments