-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converts
ColorConstant
values to an enum (#85)
This change converts the values in `ColorConstants` to an enum which allows for better logging of color commands. It also limits the color commands to the actual subsystem LED subsegment length rather than assuming the subsystem owns the full count.
- Loading branch information
Showing
10 changed files
with
234 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2025 Newport Robotics Group. All Rights Reserved. | ||
* | ||
* Open Source Software; you can modify and/or share it under the terms of | ||
* the license file in the root directory of this project. | ||
*/ | ||
|
||
package frc.robot.parameters; | ||
|
||
import edu.wpi.first.wpilibj.util.Color8Bit; | ||
|
||
/** An enum representing common RGB colors used with the status LEDs. */ | ||
public enum Colors { | ||
BLACK(0, 0, 0), | ||
WHITE(200, 200, 200), | ||
RED(255, 0, 0), | ||
ORANGE(255, 119, 0), | ||
YELLOW(255, 165, 0), | ||
GREEN(0, 204, 0), | ||
BLUE(0, 0, 204), | ||
PURPLE(238, 80, 255), | ||
PINK(255, 5, 100), | ||
LIGHT_BLUE(56, 197, 252); | ||
|
||
private final Color8Bit color; | ||
|
||
/** Constructs a variant of this enum. */ | ||
Colors(int red, int green, int blue) { | ||
color = new Color8Bit(red, green, blue); | ||
} | ||
|
||
/** Returns the red component of this enum variant. */ | ||
public int getRed() { | ||
return color.red; | ||
} | ||
|
||
/** Returns the green component of this enum variant. */ | ||
public int getGreen() { | ||
return color.green; | ||
} | ||
|
||
/** Returns the blue component of this enum variant. */ | ||
public int getBlue() { | ||
return color.blue; | ||
} | ||
|
||
/** Returns the color of this enum variant. */ | ||
public Color8Bit getColor() { | ||
return color; | ||
} | ||
} |
Oops, something went wrong.