File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/main/java/frc/robot/subsystems/leds Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,9 @@ public void addLayer(LEDLayer layer) {
45
45
* @return The color of the led layers combined
46
46
*/
47
47
public Color calcColorWithOpacity (Color baseColor , Color topColor , double opacity ){
48
- int r = (int ) Math . floor ( 256 * ((( 1 - opacity ) * baseColor .red ) + (opacity * topColor .red ) ));
49
- int g = (int ) Math . floor ( 256 * ((( 1 - opacity ) * baseColor .green ) + (opacity * topColor .green ) ));
50
- int b = (int ) Math . floor ( 256 * ((( 1 - opacity ) * baseColor .blue ) + (opacity * topColor .blue ) ));
48
+ double r = ((( 1 - opacity ) * baseColor .red ) + (opacity * topColor .red ));
49
+ double g = ((( 1 - opacity ) * baseColor .green ) + (opacity * topColor .green ));
50
+ double b = ((( 1 - opacity ) * baseColor .blue ) + (opacity * topColor .blue ));
51
51
52
52
return (new Color (r , g , b ));
53
53
}
You can’t perform that action at this time.
0 commit comments