mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpiutil] Rename Color constants to all caps
This commit is contained in:
@@ -56,7 +56,7 @@ class Arm:
|
||||
30,
|
||||
wpimath.units.radiansToDegrees(self.armSim.getAngle()),
|
||||
6,
|
||||
wpiutil.Color8Bit(wpiutil.Color.kYellow),
|
||||
wpiutil.Color8Bit(wpiutil.Color.YELLOW),
|
||||
)
|
||||
|
||||
# Subsystem constructor.
|
||||
@@ -64,7 +64,7 @@ class Arm:
|
||||
|
||||
# Put Mechanism 2d to SmartDashboard
|
||||
wpilib.SmartDashboard.putData("Arm Sim", self.mech2d)
|
||||
self.armTower.setColor(wpiutil.Color8Bit(wpiutil.Color.kBlue))
|
||||
self.armTower.setColor(wpiutil.Color8Bit(wpiutil.Color.BLUE))
|
||||
|
||||
# Set the Arm position setpoint and P constant to Preferences if the keys don't already exist
|
||||
wpilib.Preferences.initDouble(
|
||||
|
||||
@@ -42,7 +42,7 @@ class MyRobot(wpilib.TimedRobot):
|
||||
"elevator", self.kElevatorMinimumLength, 90
|
||||
)
|
||||
self.wrist = self.elevator.appendLigament(
|
||||
"wrist", 0.5, 90, 6, wpiutil.Color8Bit(wpiutil.Color.kPurple)
|
||||
"wrist", 0.5, 90, 6, wpiutil.Color8Bit(wpiutil.Color.PURPLE)
|
||||
)
|
||||
|
||||
# post the mechanism to the dashboard
|
||||
|
||||
@@ -215,7 +215,7 @@ LEDPattern LEDPattern::AtBrightness(double relativeBrightness) {
|
||||
// Static constants and functions
|
||||
|
||||
LEDPattern LEDPattern::Off() {
|
||||
return LEDPattern::Solid(wpi::util::Color::kBlack);
|
||||
return LEDPattern::Solid(wpi::util::Color::BLACK);
|
||||
}
|
||||
|
||||
LEDPattern LEDPattern::Solid(const wpi::util::Color color) {
|
||||
@@ -235,10 +235,10 @@ LEDPattern LEDPattern::ProgressMaskLayer(
|
||||
size_t max = bufLen * progress;
|
||||
|
||||
for (size_t led = 0; led < max; led++) {
|
||||
writer(led, wpi::util::Color::kWhite);
|
||||
writer(led, wpi::util::Color::WHITE);
|
||||
}
|
||||
for (size_t led = max; led < bufLen; led++) {
|
||||
writer(led, wpi::util::Color::kBlack);
|
||||
writer(led, wpi::util::Color::BLACK);
|
||||
}
|
||||
}};
|
||||
}
|
||||
@@ -265,7 +265,7 @@ LEDPattern LEDPattern::Steps(
|
||||
for (auto step : steps) {
|
||||
stopPositions[std::floor(step.first * bufLen)] = step.second;
|
||||
}
|
||||
auto currentColor = wpi::util::Color::kBlack;
|
||||
auto currentColor = wpi::util::Color::BLACK;
|
||||
for (size_t led = 0; led < bufLen; led++) {
|
||||
if (stopPositions.contains(led)) {
|
||||
currentColor = stopPositions[led];
|
||||
|
||||
@@ -199,7 +199,7 @@ class LEDPattern {
|
||||
|
||||
/**
|
||||
* Creates a pattern that plays this pattern overlaid on another. Anywhere
|
||||
* this pattern sets an LED to off (or {@link wpi::util::Color::kBlack}), the
|
||||
* this pattern sets an LED to off (or {@link wpi::util::Color::BLACK}), the
|
||||
* base pattern will be displayed instead.
|
||||
*
|
||||
* @param base the base pattern to overlay on top of
|
||||
@@ -231,7 +231,7 @@ class LEDPattern {
|
||||
* pattern by applying a mask that sets the desired area to white, and all
|
||||
* other areas to black. However, it can also be used to display only certain
|
||||
* color channels or hues; for example, masking with {@code
|
||||
* LEDPattern.color(Color.kRed)} will turn off the green and blue channels on
|
||||
* LEDPattern.color(Color.RED)} will turn off the green and blue channels on
|
||||
* the output pattern, leaving only the red LEDs to be illuminated.
|
||||
*
|
||||
* @param mask the mask to apply
|
||||
@@ -256,10 +256,10 @@ class LEDPattern {
|
||||
*
|
||||
* <pre>
|
||||
* // Solid red, but at 50% brightness
|
||||
* wpi::LEDPattern::Solid(wpi::util::Color::kRed).AtBrightness(0.5);
|
||||
* wpi::LEDPattern::Solid(wpi::util::Color::RED).AtBrightness(0.5);
|
||||
*
|
||||
* // Solid white, but at only 10% (i.e. ~0.5V)
|
||||
* wpi::LEDPattern::Solid(wpi::util::Color::kWhite).AtBrightness(0.1);
|
||||
* wpi::LEDPattern::Solid(wpi::util::Color::WHITE).AtBrightness(0.1);
|
||||
* </pre>
|
||||
*
|
||||
* @param relativeBrightness the multiplier to apply to all channels to modify
|
||||
@@ -296,8 +296,8 @@ class LEDPattern {
|
||||
*
|
||||
* <pre>
|
||||
* wpi::LEDPattern basePattern =
|
||||
* wpi::LEDPattern::Gradient(wpi::util::Color::kRed,
|
||||
* wpi::util::Color::kBlue); wpi::LEDPattern progressPattern =
|
||||
* wpi::LEDPattern::Gradient(wpi::util::Color::RED,
|
||||
* wpi::util::Color::BLUE); wpi::LEDPattern progressPattern =
|
||||
* basePattern.Mask(wpi::LEDPattern::ProgressMaskLayer([&]() {
|
||||
* return elevator.GetHeight() / elevator.MaxHeight();
|
||||
* });
|
||||
|
||||
@@ -16,13 +16,13 @@ static LEDPattern whiteYellowPurple{[](auto data, auto writer) {
|
||||
for (size_t led = 0; led < data.size(); led++) {
|
||||
switch (led % 3) {
|
||||
case 0:
|
||||
writer(led, wpi::util::Color::kWhite);
|
||||
writer(led, wpi::util::Color::WHITE);
|
||||
break;
|
||||
case 1:
|
||||
writer(led, wpi::util::Color::kYellow);
|
||||
writer(led, wpi::util::Color::YELLOW);
|
||||
break;
|
||||
case 2:
|
||||
writer(led, wpi::util::Color::kPurple);
|
||||
writer(led, wpi::util::Color::PURPLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -33,17 +33,17 @@ void AssertIndexColor(std::span<AddressableLED::LEDData> data, int index,
|
||||
wpi::util::Color LerpColors(wpi::util::Color a, wpi::util::Color b, double t);
|
||||
|
||||
TEST(LEDPatternTest, SolidColor) {
|
||||
LEDPattern pattern = LEDPattern::Solid(wpi::util::Color::kYellow);
|
||||
LEDPattern pattern = LEDPattern::Solid(wpi::util::Color::YELLOW);
|
||||
std::array<AddressableLED::LEDData, 5> buffer;
|
||||
|
||||
// prefill
|
||||
for (int i = 0; i < 5; i++) {
|
||||
buffer[i].SetLED(wpi::util::Color::kPurple);
|
||||
buffer[i].SetLED(wpi::util::Color::PURPLE);
|
||||
}
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
for (int i = 0; i < 5; i++) {
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::YELLOW);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,97 +54,97 @@ TEST(LEDPatternTest, EmptyGradientSetsToBlack) {
|
||||
std::array<AddressableLED::LEDData, 5> buffer;
|
||||
pattern.ApplyTo(buffer);
|
||||
for (int i = 0; i < 5; i++) {
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, SingleColorGradientSetsSolid) {
|
||||
std::array<wpi::util::Color, 1> colors{wpi::util::Color::kYellow};
|
||||
std::array<wpi::util::Color, 1> colors{wpi::util::Color::YELLOW};
|
||||
LEDPattern pattern =
|
||||
LEDPattern::Gradient(LEDPattern::GradientType::kContinuous, colors);
|
||||
std::array<AddressableLED::LEDData, 5> buffer;
|
||||
pattern.ApplyTo(buffer);
|
||||
for (int i = 0; i < 5; i++) {
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::YELLOW);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, Gradient2Colors) {
|
||||
std::array<wpi::util::Color, 2> colors{wpi::util::Color::kYellow,
|
||||
wpi::util::Color::kPurple};
|
||||
std::array<wpi::util::Color, 2> colors{wpi::util::Color::YELLOW,
|
||||
wpi::util::Color::PURPLE};
|
||||
LEDPattern pattern =
|
||||
LEDPattern::Gradient(LEDPattern::GradientType::kContinuous, colors);
|
||||
std::array<AddressableLED::LEDData, 99> buffer;
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::YELLOW);
|
||||
AssertIndexColor(buffer, 25,
|
||||
LerpColors(wpi::util::Color::kYellow,
|
||||
wpi::util::Color::kPurple, 25 / 49.0));
|
||||
AssertIndexColor(buffer, 49, wpi::util::Color::kPurple);
|
||||
LerpColors(wpi::util::Color::YELLOW,
|
||||
wpi::util::Color::PURPLE, 25 / 49.0));
|
||||
AssertIndexColor(buffer, 49, wpi::util::Color::PURPLE);
|
||||
AssertIndexColor(buffer, 74,
|
||||
LerpColors(wpi::util::Color::kPurple,
|
||||
wpi::util::Color::kYellow, 25 / 49.0));
|
||||
AssertIndexColor(buffer, 98, wpi::util::Color::kYellow);
|
||||
LerpColors(wpi::util::Color::PURPLE,
|
||||
wpi::util::Color::YELLOW, 25 / 49.0));
|
||||
AssertIndexColor(buffer, 98, wpi::util::Color::YELLOW);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, DiscontinuousGradient2Colors) {
|
||||
std::array<wpi::util::Color, 2> colors{wpi::util::Color::kYellow,
|
||||
wpi::util::Color::kPurple};
|
||||
std::array<wpi::util::Color, 2> colors{wpi::util::Color::YELLOW,
|
||||
wpi::util::Color::PURPLE};
|
||||
LEDPattern pattern =
|
||||
LEDPattern::Gradient(LEDPattern::GradientType::kDiscontinuous, colors);
|
||||
std::array<AddressableLED::LEDData, 99> buffer;
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::YELLOW);
|
||||
AssertIndexColor(
|
||||
buffer, 49,
|
||||
LerpColors(wpi::util::Color::kYellow, wpi::util::Color::kPurple, 0.5));
|
||||
AssertIndexColor(buffer, 98, wpi::util::Color::kPurple);
|
||||
LerpColors(wpi::util::Color::YELLOW, wpi::util::Color::PURPLE, 0.5));
|
||||
AssertIndexColor(buffer, 98, wpi::util::Color::PURPLE);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, Gradient3Colors) {
|
||||
std::array<wpi::util::Color, 3> colors{wpi::util::Color::kYellow,
|
||||
wpi::util::Color::kPurple,
|
||||
wpi::util::Color::kWhite};
|
||||
std::array<wpi::util::Color, 3> colors{wpi::util::Color::YELLOW,
|
||||
wpi::util::Color::PURPLE,
|
||||
wpi::util::Color::WHITE};
|
||||
LEDPattern pattern =
|
||||
LEDPattern::Gradient(LEDPattern::GradientType::kContinuous, colors);
|
||||
std::array<AddressableLED::LEDData, 99> buffer;
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::YELLOW);
|
||||
AssertIndexColor(buffer, 25,
|
||||
LerpColors(wpi::util::Color::kYellow,
|
||||
wpi::util::Color::kPurple, 25 / 33.0));
|
||||
AssertIndexColor(buffer, 33, wpi::util::Color::kPurple);
|
||||
AssertIndexColor(buffer, 58,
|
||||
LerpColors(wpi::util::Color::kPurple,
|
||||
wpi::util::Color::kWhite, 25 / 33.0));
|
||||
AssertIndexColor(buffer, 66, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, 91,
|
||||
LerpColors(wpi::util::Color::kWhite,
|
||||
wpi::util::Color::kYellow, 25 / 33.0));
|
||||
AssertIndexColor(buffer, 98,
|
||||
LerpColors(wpi::util::Color::kWhite,
|
||||
wpi::util::Color::kYellow, 32 / 33.0));
|
||||
LerpColors(wpi::util::Color::YELLOW,
|
||||
wpi::util::Color::PURPLE, 25 / 33.0));
|
||||
AssertIndexColor(buffer, 33, wpi::util::Color::PURPLE);
|
||||
AssertIndexColor(
|
||||
buffer, 58,
|
||||
LerpColors(wpi::util::Color::PURPLE, wpi::util::Color::WHITE, 25 / 33.0));
|
||||
AssertIndexColor(buffer, 66, wpi::util::Color::WHITE);
|
||||
AssertIndexColor(
|
||||
buffer, 91,
|
||||
LerpColors(wpi::util::Color::WHITE, wpi::util::Color::YELLOW, 25 / 33.0));
|
||||
AssertIndexColor(
|
||||
buffer, 98,
|
||||
LerpColors(wpi::util::Color::WHITE, wpi::util::Color::YELLOW, 32 / 33.0));
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, DiscontinuousGradient3Colors) {
|
||||
std::array<wpi::util::Color, 3> colors{wpi::util::Color::kYellow,
|
||||
wpi::util::Color::kPurple,
|
||||
wpi::util::Color::kWhite};
|
||||
std::array<wpi::util::Color, 3> colors{wpi::util::Color::YELLOW,
|
||||
wpi::util::Color::PURPLE,
|
||||
wpi::util::Color::WHITE};
|
||||
LEDPattern pattern =
|
||||
LEDPattern::Gradient(LEDPattern::GradientType::kDiscontinuous, colors);
|
||||
std::array<AddressableLED::LEDData, 101> buffer;
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::YELLOW);
|
||||
AssertIndexColor(
|
||||
buffer, 25,
|
||||
LerpColors(wpi::util::Color::kYellow, wpi::util::Color::kPurple, 0.5));
|
||||
AssertIndexColor(buffer, 50, wpi::util::Color::kPurple);
|
||||
LerpColors(wpi::util::Color::YELLOW, wpi::util::Color::PURPLE, 0.5));
|
||||
AssertIndexColor(buffer, 50, wpi::util::Color::PURPLE);
|
||||
AssertIndexColor(
|
||||
buffer, 75,
|
||||
LerpColors(wpi::util::Color::kPurple, wpi::util::Color::kWhite, 0.5));
|
||||
AssertIndexColor(buffer, 100, wpi::util::Color::kWhite);
|
||||
LerpColors(wpi::util::Color::PURPLE, wpi::util::Color::WHITE, 0.5));
|
||||
AssertIndexColor(buffer, 100, wpi::util::Color::WHITE);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, EmptyStepsSetsToBlack) {
|
||||
@@ -154,32 +154,32 @@ TEST(LEDPatternTest, EmptyStepsSetsToBlack) {
|
||||
|
||||
// prefill
|
||||
for (int i = 0; i < 5; i++) {
|
||||
buffer[i].SetLED(wpi::util::Color::kPurple);
|
||||
buffer[i].SetLED(wpi::util::Color::PURPLE);
|
||||
}
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, SingleStepSetsSolid) {
|
||||
std::array<std::pair<double, wpi::util::Color>, 1> steps{
|
||||
std::pair{0.0, wpi::util::Color::kYellow}};
|
||||
std::pair{0.0, wpi::util::Color::YELLOW}};
|
||||
LEDPattern pattern = LEDPattern::Steps(steps);
|
||||
std::array<AddressableLED::LEDData, 5> buffer;
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::YELLOW);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, SingleHalfStepSetsHalfOffHalfColor) {
|
||||
std::array<std::pair<double, wpi::util::Color>, 1> steps{
|
||||
std::pair{0.5, wpi::util::Color::kYellow}};
|
||||
std::pair{0.5, wpi::util::Color::YELLOW}};
|
||||
LEDPattern pattern = LEDPattern::Steps(steps);
|
||||
std::array<AddressableLED::LEDData, 99> buffer;
|
||||
|
||||
@@ -187,12 +187,12 @@ TEST(LEDPatternTest, SingleHalfStepSetsHalfOffHalfColor) {
|
||||
|
||||
// [0, 48] should be black...
|
||||
for (int i = 0; i < 49; i++) {
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::BLACK);
|
||||
}
|
||||
|
||||
// ... and [49, <end>] should be the color that was set
|
||||
for (int i = 49; i < 99; i++) {
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::YELLOW);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ TEST(LEDPatternTest, RainbowOddSize) {
|
||||
|
||||
TEST(LEDPatternTest, ReverseSolid) {
|
||||
std::array<AddressableLED::LEDData, 90> buffer;
|
||||
const auto color = wpi::util::Color::kRosyBrown;
|
||||
const auto color = wpi::util::Color::ROSY_BROWN;
|
||||
|
||||
auto solid = LEDPattern::Solid(color);
|
||||
auto pattern = solid.Reversed();
|
||||
@@ -453,15 +453,15 @@ TEST(LEDPatternTest, ReverseSolid) {
|
||||
|
||||
for (int led = 0; led < 90; led++) {
|
||||
SCOPED_TRACE(fmt::format("LED {} of 90", led + 1));
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kRosyBrown);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::ROSY_BROWN);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, ReverseSteps) {
|
||||
std::array<AddressableLED::LEDData, 100> buffer;
|
||||
std::array<std::pair<double, wpi::util::Color>, 2> steps{
|
||||
std::pair{0.0, wpi::util::Color::kPlum},
|
||||
std::pair{0.5, wpi::util::Color::kYellow}};
|
||||
std::pair{0.0, wpi::util::Color::PLUM},
|
||||
std::pair{0.5, wpi::util::Color::YELLOW}};
|
||||
auto stepPattern = LEDPattern::Steps(steps);
|
||||
auto pattern = stepPattern.Reversed();
|
||||
|
||||
@@ -470,11 +470,11 @@ TEST(LEDPatternTest, ReverseSteps) {
|
||||
// colors should be swapped; yellow first, then plum
|
||||
for (int led = 0; led < 50; led++) {
|
||||
SCOPED_TRACE(fmt::format("LED {} of 100", led + 1));
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::YELLOW);
|
||||
}
|
||||
for (int led = 50; led < 100; led++) {
|
||||
SCOPED_TRACE(fmt::format("LED {} of 100", led + 1));
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kPlum);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::PLUM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,13 +487,13 @@ TEST(LEDPatternTest, OffsetPositive) {
|
||||
SCOPED_TRACE(fmt::format("LED {} of 21", led + 1));
|
||||
switch (led % 3) {
|
||||
case 0:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kPurple);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::PURPLE);
|
||||
break;
|
||||
case 1:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::WHITE);
|
||||
break;
|
||||
case 2:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::YELLOW);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -508,13 +508,13 @@ TEST(LEDPatternTest, OffsetNegative) {
|
||||
SCOPED_TRACE(fmt::format("LED {} of 21", led + 1));
|
||||
switch (led % 3) {
|
||||
case 0:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::YELLOW);
|
||||
break;
|
||||
case 1:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kPurple);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::PURPLE);
|
||||
break;
|
||||
case 2:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::WHITE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -529,13 +529,13 @@ TEST(LEDPatternTest, OffsetZero) {
|
||||
SCOPED_TRACE(fmt::format("LED {} of 21", led + 1));
|
||||
switch (led % 3) {
|
||||
case 0:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::WHITE);
|
||||
break;
|
||||
case 1:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::YELLOW);
|
||||
break;
|
||||
case 2:
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::kPurple);
|
||||
AssertIndexColor(buffer, led, wpi::util::Color::PURPLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -543,7 +543,7 @@ TEST(LEDPatternTest, OffsetZero) {
|
||||
|
||||
TEST(LEDPatternTest, BlinkSymmetric) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
auto white = LEDPattern::Solid(wpi::util::Color::kWhite);
|
||||
auto white = LEDPattern::Solid(wpi::util::Color::WHITE);
|
||||
|
||||
// on for 2 seconds, off for 2 seconds
|
||||
auto pattern = white.Blink(2_s);
|
||||
@@ -560,13 +560,13 @@ TEST(LEDPatternTest, BlinkSymmetric) {
|
||||
case 1:
|
||||
case 4:
|
||||
case 5:
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::WHITE);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 6:
|
||||
case 7:
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -576,7 +576,7 @@ TEST(LEDPatternTest, BlinkSymmetric) {
|
||||
|
||||
TEST(LEDPatternTest, BlinkAsymmetric) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
auto white = LEDPattern::Solid(wpi::util::Color::kWhite);
|
||||
auto white = LEDPattern::Solid(wpi::util::Color::WHITE);
|
||||
|
||||
// on for 3 seconds, off for 1 second
|
||||
auto pattern = white.Blink(3_s, 1_s);
|
||||
@@ -595,11 +595,11 @@ TEST(LEDPatternTest, BlinkAsymmetric) {
|
||||
case 4:
|
||||
case 5:
|
||||
case 6: // second period
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::WHITE);
|
||||
break;
|
||||
case 3:
|
||||
case 7:
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -609,7 +609,7 @@ TEST(LEDPatternTest, BlinkAsymmetric) {
|
||||
|
||||
TEST(LEDPatternTest, BlinkInSync) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
auto white = LEDPattern::Solid(wpi::util::Color::kWhite);
|
||||
auto white = LEDPattern::Solid(wpi::util::Color::WHITE);
|
||||
|
||||
bool flag = false;
|
||||
auto condition = [&flag]() { return flag; };
|
||||
@@ -618,23 +618,23 @@ TEST(LEDPatternTest, BlinkInSync) {
|
||||
|
||||
SCOPED_TRACE("Flag off");
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
|
||||
SCOPED_TRACE("Flag on");
|
||||
flag = true;
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::WHITE);
|
||||
|
||||
SCOPED_TRACE("Flag off");
|
||||
flag = false;
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, Breathe) {
|
||||
wpi::util::Color midGray{0.5, 0.5, 0.5};
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
auto white = LEDPattern::Solid(wpi::util::Color::kWhite);
|
||||
auto white = LEDPattern::Solid(wpi::util::Color::WHITE);
|
||||
auto pattern = white.Breathe(4_us);
|
||||
|
||||
static uint64_t now = 0ull;
|
||||
@@ -645,7 +645,7 @@ TEST(LEDPatternTest, Breathe) {
|
||||
SCOPED_TRACE(fmt::format("Time {}", now));
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::WHITE);
|
||||
}
|
||||
{
|
||||
now = 1ull; // midway (down)
|
||||
@@ -659,7 +659,7 @@ TEST(LEDPatternTest, Breathe) {
|
||||
SCOPED_TRACE(fmt::format("Time {}", now));
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
}
|
||||
{
|
||||
now = 3ull; // midway (up)
|
||||
@@ -673,7 +673,7 @@ TEST(LEDPatternTest, Breathe) {
|
||||
SCOPED_TRACE(fmt::format("Time {}", now));
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::WHITE);
|
||||
}
|
||||
WPI_SetNowImpl(nullptr); // cleanup
|
||||
}
|
||||
@@ -681,18 +681,18 @@ TEST(LEDPatternTest, Breathe) {
|
||||
TEST(LEDPatternTest, OverlaySolidOnSolid) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::kWhite);
|
||||
auto overlay = LEDPattern::Solid(wpi::util::Color::kYellow);
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::WHITE);
|
||||
auto overlay = LEDPattern::Solid(wpi::util::Color::YELLOW);
|
||||
auto pattern = overlay.OverlayOn(base);
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::YELLOW);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, OverlayNearlyBlack) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::kWhite);
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::WHITE);
|
||||
auto overlay = LEDPattern::Solid(wpi::util::Color{1, 0, 0});
|
||||
auto pattern = overlay.OverlayOn(base);
|
||||
pattern.ApplyTo(buffer);
|
||||
@@ -703,23 +703,23 @@ TEST(LEDPatternTest, OverlayNearlyBlack) {
|
||||
TEST(LEDPatternTest, OverlayMixed) {
|
||||
std::array<AddressableLED::LEDData, 2> buffer;
|
||||
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::kWhite);
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::WHITE);
|
||||
std::array<std::pair<double, wpi::util::Color>, 2> steps{
|
||||
std::pair{0.0, wpi::util::Color::kYellow},
|
||||
std::pair{0.5, wpi::util::Color::kBlack}};
|
||||
std::pair{0.0, wpi::util::Color::YELLOW},
|
||||
std::pair{0.5, wpi::util::Color::BLACK}};
|
||||
auto overlay = LEDPattern::Steps(steps);
|
||||
auto pattern = overlay.OverlayOn(base);
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kYellow);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::YELLOW);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::WHITE);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, Blend) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
|
||||
auto pattern1 = LEDPattern::Solid(wpi::util::Color::kBlue);
|
||||
auto pattern2 = LEDPattern::Solid(wpi::util::Color::kRed);
|
||||
auto pattern1 = LEDPattern::Solid(wpi::util::Color::BLUE);
|
||||
auto pattern2 = LEDPattern::Solid(wpi::util::Color::RED);
|
||||
auto blend = pattern1.Blend(pattern2);
|
||||
blend.ApplyTo(buffer);
|
||||
|
||||
@@ -736,8 +736,8 @@ TEST(LEDPatternTest, BinaryMask) {
|
||||
|
||||
// first 50% mask on, last 50% mask off
|
||||
std::array<std::pair<double, wpi::util::Color>, 2> steps{
|
||||
std::pair{0.0, wpi::util::Color::kWhite},
|
||||
std::pair{0.5, wpi::util::Color::kBlack}};
|
||||
std::pair{0.0, wpi::util::Color::WHITE},
|
||||
std::pair{0.5, wpi::util::Color::BLACK}};
|
||||
auto mask = LEDPattern::Steps(steps);
|
||||
auto masked = base.Mask(mask);
|
||||
masked.ApplyTo(buffer);
|
||||
@@ -747,7 +747,7 @@ TEST(LEDPatternTest, BinaryMask) {
|
||||
}
|
||||
|
||||
for (int i = 5; i < 10; i++) {
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -758,10 +758,10 @@ TEST(LEDPatternTest, ChannelwiseMask) {
|
||||
wpi::util::Color halfGray{0.5, 0.5, 0.5};
|
||||
auto base = LEDPattern::Solid(baseColor);
|
||||
std::array<std::pair<double, wpi::util::Color>, 5> steps{
|
||||
std::pair{0.0, wpi::util::Color::kRed},
|
||||
std::pair{0.2, wpi::util::Color::kLime},
|
||||
std::pair{0.4, wpi::util::Color::kBlue}, std::pair{0.6, halfGray},
|
||||
std::pair{0.8, wpi::util::Color::kWhite}};
|
||||
std::pair{0.0, wpi::util::Color::RED},
|
||||
std::pair{0.2, wpi::util::Color::LIME},
|
||||
std::pair{0.4, wpi::util::Color::BLUE}, std::pair{0.6, halfGray},
|
||||
std::pair{0.8, wpi::util::Color::WHITE}};
|
||||
auto mask = LEDPattern::Steps(steps);
|
||||
auto masked = base.Mask(mask);
|
||||
masked.ApplyTo(buffer);
|
||||
@@ -791,11 +791,11 @@ TEST(LEDPatternTest, ProcessMaskLayer) {
|
||||
int lastMaskedLED = static_cast<int>(t * 100);
|
||||
for (int i = 0; i < lastMaskedLED; i++) {
|
||||
SCOPED_TRACE(fmt::format("LED {}", i));
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::WHITE);
|
||||
}
|
||||
for (int i = lastMaskedLED; i < 100; i++) {
|
||||
SCOPED_TRACE(fmt::format("LED {}", i));
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, i, wpi::util::Color::BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -803,58 +803,58 @@ TEST(LEDPatternTest, ProcessMaskLayer) {
|
||||
TEST(LEDPatternTest, ZeroBrightness) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::kRed);
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::RED);
|
||||
auto pattern = base.AtBrightness(0);
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, SameBrightness) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::kMagenta);
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::MAGENTA);
|
||||
auto pattern = base.AtBrightness(1.0);
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kMagenta);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::MAGENTA);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, HigherBrightness) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::kMagenta);
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::MAGENTA);
|
||||
auto pattern = base.AtBrightness(4 / 3.0);
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kMagenta);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::MAGENTA);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, NegativeBrightness) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::kWhite);
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::WHITE);
|
||||
auto pattern = base.AtBrightness(-1.0);
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, ClippingBrightness) {
|
||||
std::array<AddressableLED::LEDData, 1> buffer;
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::kMidnightBlue);
|
||||
auto base = LEDPattern::Solid(wpi::util::Color::MIDNIGHT_BLUE);
|
||||
auto pattern = base.AtBrightness(100);
|
||||
pattern.ApplyTo(buffer);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kWhite);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::WHITE);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, ReverseMask) {
|
||||
std::array<AddressableLED::LEDData, 8> buffer;
|
||||
|
||||
std::array<std::pair<double, wpi::util::Color>, 4> colorSteps{
|
||||
std::pair{0.0, wpi::util::Color::kRed},
|
||||
std::pair{0.25, wpi::util::Color::kBlue},
|
||||
std::pair{0.5, wpi::util::Color::kYellow},
|
||||
std::pair{0.75, wpi::util::Color::kGreen}};
|
||||
std::pair{0.0, wpi::util::Color::RED},
|
||||
std::pair{0.25, wpi::util::Color::BLUE},
|
||||
std::pair{0.5, wpi::util::Color::YELLOW},
|
||||
std::pair{0.75, wpi::util::Color::GREEN}};
|
||||
std::array<std::pair<double, wpi::util::Color>, 2> maskSteps{
|
||||
std::pair{0, wpi::util::Color::kWhite},
|
||||
std::pair{0.5, wpi::util::Color::kBlack}};
|
||||
std::pair{0, wpi::util::Color::WHITE},
|
||||
std::pair{0.5, wpi::util::Color::BLACK}};
|
||||
|
||||
auto pattern = LEDPattern::Steps(colorSteps)
|
||||
.Mask(LEDPattern::Steps(maskSteps))
|
||||
@@ -862,27 +862,27 @@ TEST(LEDPatternTest, ReverseMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, OffsetMask) {
|
||||
std::array<AddressableLED::LEDData, 8> buffer;
|
||||
|
||||
std::array<std::pair<double, wpi::util::Color>, 4> colorSteps{
|
||||
std::pair{0.0, wpi::util::Color::kRed},
|
||||
std::pair{0.25, wpi::util::Color::kBlue},
|
||||
std::pair{0.5, wpi::util::Color::kYellow},
|
||||
std::pair{0.75, wpi::util::Color::kGreen}};
|
||||
std::pair{0.0, wpi::util::Color::RED},
|
||||
std::pair{0.25, wpi::util::Color::BLUE},
|
||||
std::pair{0.5, wpi::util::Color::YELLOW},
|
||||
std::pair{0.75, wpi::util::Color::GREEN}};
|
||||
std::array<std::pair<double, wpi::util::Color>, 2> maskSteps{
|
||||
std::pair{0, wpi::util::Color::kWhite},
|
||||
std::pair{0.5, wpi::util::Color::kBlack}};
|
||||
std::pair{0, wpi::util::Color::WHITE},
|
||||
std::pair{0.5, wpi::util::Color::BLACK}};
|
||||
|
||||
auto pattern = LEDPattern::Steps(colorSteps)
|
||||
.Mask(LEDPattern::Steps(maskSteps))
|
||||
@@ -890,27 +890,27 @@ TEST(LEDPatternTest, OffsetMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLUE);
|
||||
}
|
||||
|
||||
TEST(LEDPatternTest, RelativeScrollingMask) {
|
||||
std::array<AddressableLED::LEDData, 8> buffer;
|
||||
|
||||
std::array<std::pair<double, wpi::util::Color>, 4> colorSteps{
|
||||
std::pair{0.0, wpi::util::Color::kRed},
|
||||
std::pair{0.25, wpi::util::Color::kBlue},
|
||||
std::pair{0.5, wpi::util::Color::kYellow},
|
||||
std::pair{0.75, wpi::util::Color::kGreen}};
|
||||
std::pair{0.0, wpi::util::Color::RED},
|
||||
std::pair{0.25, wpi::util::Color::BLUE},
|
||||
std::pair{0.5, wpi::util::Color::YELLOW},
|
||||
std::pair{0.75, wpi::util::Color::GREEN}};
|
||||
std::array<std::pair<double, wpi::util::Color>, 2> maskSteps{
|
||||
std::pair{0, wpi::util::Color::kWhite},
|
||||
std::pair{0.5, wpi::util::Color::kBlack}};
|
||||
std::pair{0, wpi::util::Color::WHITE},
|
||||
std::pair{0.5, wpi::util::Color::BLACK}};
|
||||
|
||||
auto pattern = LEDPattern::Steps(colorSteps)
|
||||
.Mask(LEDPattern::Steps(maskSteps))
|
||||
@@ -927,14 +927,14 @@ TEST(LEDPatternTest, RelativeScrollingMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLACK);
|
||||
}
|
||||
{
|
||||
now = 1ull;
|
||||
@@ -942,14 +942,14 @@ TEST(LEDPatternTest, RelativeScrollingMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLACK);
|
||||
}
|
||||
{
|
||||
now = 2ull;
|
||||
@@ -957,14 +957,14 @@ TEST(LEDPatternTest, RelativeScrollingMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLACK);
|
||||
}
|
||||
{
|
||||
now = 3ull;
|
||||
@@ -972,14 +972,14 @@ TEST(LEDPatternTest, RelativeScrollingMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLACK);
|
||||
}
|
||||
|
||||
WPI_SetNowImpl(nullptr); // cleanup
|
||||
@@ -989,13 +989,13 @@ TEST(LEDPatternTest, AbsoluteScrollingMask) {
|
||||
std::array<AddressableLED::LEDData, 8> buffer;
|
||||
|
||||
std::array<std::pair<double, wpi::util::Color>, 4> colorSteps{
|
||||
std::pair{0.0, wpi::util::Color::kRed},
|
||||
std::pair{0.25, wpi::util::Color::kBlue},
|
||||
std::pair{0.5, wpi::util::Color::kYellow},
|
||||
std::pair{0.75, wpi::util::Color::kGreen}};
|
||||
std::pair{0.0, wpi::util::Color::RED},
|
||||
std::pair{0.25, wpi::util::Color::BLUE},
|
||||
std::pair{0.5, wpi::util::Color::YELLOW},
|
||||
std::pair{0.75, wpi::util::Color::GREEN}};
|
||||
std::array<std::pair<double, wpi::util::Color>, 2> maskSteps{
|
||||
std::pair{0, wpi::util::Color::kWhite},
|
||||
std::pair{0.5, wpi::util::Color::kBlack}};
|
||||
std::pair{0, wpi::util::Color::WHITE},
|
||||
std::pair{0.5, wpi::util::Color::BLACK}};
|
||||
|
||||
auto pattern = LEDPattern::Steps(colorSteps)
|
||||
.Mask(LEDPattern::Steps(maskSteps))
|
||||
@@ -1012,14 +1012,14 @@ TEST(LEDPatternTest, AbsoluteScrollingMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLACK);
|
||||
}
|
||||
{
|
||||
now = 1000000ull;
|
||||
@@ -1027,14 +1027,14 @@ TEST(LEDPatternTest, AbsoluteScrollingMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLACK);
|
||||
}
|
||||
{
|
||||
now = 2000000ull;
|
||||
@@ -1042,14 +1042,14 @@ TEST(LEDPatternTest, AbsoluteScrollingMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLACK);
|
||||
}
|
||||
{
|
||||
now = 3000000ull;
|
||||
@@ -1057,14 +1057,14 @@ TEST(LEDPatternTest, AbsoluteScrollingMask) {
|
||||
|
||||
pattern.ApplyTo(buffer);
|
||||
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::kRed);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::kBlue);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::kBlack);
|
||||
AssertIndexColor(buffer, 0, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 1, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 2, wpi::util::Color::BLACK);
|
||||
AssertIndexColor(buffer, 3, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 4, wpi::util::Color::RED);
|
||||
AssertIndexColor(buffer, 5, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 6, wpi::util::Color::BLUE);
|
||||
AssertIndexColor(buffer, 7, wpi::util::Color::BLACK);
|
||||
}
|
||||
|
||||
WPI_SetNowImpl(nullptr); // cleanup
|
||||
|
||||
@@ -65,11 +65,11 @@ TEST_F(OpModeRobotTest, AddOpMode) {
|
||||
struct MyMockRobot : public MockRobot {
|
||||
MyMockRobot() {
|
||||
AddOpMode<MockOpMode>(wpi::RobotMode::AUTONOMOUS, "NoArgOpMode-Auto",
|
||||
"Group", "Description", wpi::util::Color::kWhite,
|
||||
wpi::util::Color::kBlack);
|
||||
"Group", "Description", wpi::util::Color::WHITE,
|
||||
wpi::util::Color::BLACK);
|
||||
AddOpMode<OneArgOpMode>(wpi::RobotMode::TEST, "OneArgOpMode-Test",
|
||||
"Group", "Description", wpi::util::Color::kWhite,
|
||||
wpi::util::Color::kBlack);
|
||||
"Group", "Description", wpi::util::Color::WHITE,
|
||||
wpi::util::Color::BLACK);
|
||||
AddOpMode<MockOpMode>(wpi::RobotMode::TELEOPERATED, "NoArgOpMode");
|
||||
AddOpMode<OneArgOpMode>(wpi::RobotMode::TELEOPERATED, "OneArgOpMode");
|
||||
PublishOpModes();
|
||||
|
||||
@@ -68,8 +68,8 @@ def test_add_op_mode():
|
||||
"NoArgOpMode-Auto",
|
||||
"Group",
|
||||
"Description",
|
||||
Color.kWhite,
|
||||
Color.kBlack,
|
||||
Color.WHITE,
|
||||
Color.BLACK,
|
||||
)
|
||||
self.addOpMode(
|
||||
OneArgOpMode,
|
||||
@@ -77,8 +77,8 @@ def test_add_op_mode():
|
||||
"OneArgOpMode-Test",
|
||||
"Group",
|
||||
"Description",
|
||||
Color.kWhite,
|
||||
Color.kBlack,
|
||||
Color.WHITE,
|
||||
Color.BLACK,
|
||||
)
|
||||
self.addOpMode(MockOpMode, RobotMode.TELEOPERATED, "NoArgOpMode")
|
||||
self.addOpMode(OneArgOpMode, RobotMode.TELEOPERATED, "OneArgOpMode")
|
||||
|
||||
@@ -62,8 +62,8 @@ class Arm {
|
||||
wpi::MechanismLigament2d* m_armTower =
|
||||
m_armBase->Append<wpi::MechanismLigament2d>(
|
||||
"Arm Tower", 30, -90_deg, 6,
|
||||
wpi::util::Color8Bit{wpi::util::Color::kBlue});
|
||||
wpi::util::Color8Bit{wpi::util::Color::BLUE});
|
||||
wpi::MechanismLigament2d* m_arm = m_armBase->Append<wpi::MechanismLigament2d>(
|
||||
"Arm", 30, m_armSim.GetAngle(), 6,
|
||||
wpi::util::Color8Bit{wpi::util::Color::kYellow});
|
||||
wpi::util::Color8Bit{wpi::util::Color::YELLOW});
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ class Robot : public wpi::TimedRobot {
|
||||
wpi::MechanismLigament2d* m_wrist =
|
||||
m_elevator->Append<wpi::MechanismLigament2d>(
|
||||
"wrist", 0.5, 90_deg, 6,
|
||||
wpi::util::Color8Bit{wpi::util::Color::kPurple});
|
||||
wpi::util::Color8Bit{wpi::util::Color::PURPLE});
|
||||
};
|
||||
|
||||
#ifndef RUNNING_WPILIB_TESTS
|
||||
|
||||
@@ -373,7 +373,7 @@ public interface LEDPattern {
|
||||
|
||||
/**
|
||||
* Creates a pattern that plays this pattern overlaid on another. Anywhere this pattern sets an
|
||||
* LED to off (or {@link Color#kBlack}), the base pattern will be displayed instead.
|
||||
* LED to off (or {@link Color#BLACK}), the base pattern will be displayed instead.
|
||||
*
|
||||
* @param base the base pattern to overlay on top of
|
||||
* @return the combined overlay pattern
|
||||
@@ -497,7 +497,7 @@ public interface LEDPattern {
|
||||
}
|
||||
|
||||
/** A pattern that turns off all LEDs. */
|
||||
LEDPattern kOff = solid(Color.kBlack);
|
||||
LEDPattern kOff = solid(Color.BLACK);
|
||||
|
||||
/**
|
||||
* Creates a pattern that displays a single static color along the entire length of the LED strip.
|
||||
@@ -544,11 +544,11 @@ public interface LEDPattern {
|
||||
int max = (int) (bufLen * progress);
|
||||
|
||||
for (int led = 0; led < max; led++) {
|
||||
writer.setLED(led, Color.kWhite);
|
||||
writer.setLED(led, Color.WHITE);
|
||||
}
|
||||
|
||||
for (int led = max; led < bufLen; led++) {
|
||||
writer.setLED(led, Color.kBlack);
|
||||
writer.setLED(led, Color.BLACK);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -597,7 +597,7 @@ public interface LEDPattern {
|
||||
stopPositions.put((int) Math.floor(progress.doubleValue() * bufLen), color);
|
||||
});
|
||||
|
||||
Color currentColor = Color.kBlack;
|
||||
Color currentColor = Color.BLACK;
|
||||
for (int led = 0; led < bufLen; led++) {
|
||||
currentColor = Objects.requireNonNullElse(stopPositions.get(led), currentColor);
|
||||
|
||||
|
||||
@@ -53,19 +53,19 @@ class AddressableLEDBufferTest {
|
||||
@Test
|
||||
void getColorTest() {
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(4);
|
||||
final Color8Bit denimColor8Bit = new Color8Bit(Color.kDenim);
|
||||
final Color8Bit firstBlueColor8Bit = new Color8Bit(Color.kFirstBlue);
|
||||
final Color8Bit firstRedColor8Bit = new Color8Bit(Color.kFirstRed);
|
||||
final Color8Bit denimColor8Bit = new Color8Bit(Color.DENIM);
|
||||
final Color8Bit firstBlueColor8Bit = new Color8Bit(Color.FIRST_BLUE);
|
||||
final Color8Bit firstRedColor8Bit = new Color8Bit(Color.FIRST_RED);
|
||||
|
||||
buffer.setLED(0, Color.kFirstBlue);
|
||||
buffer.setLED(0, Color.FIRST_BLUE);
|
||||
buffer.setLED(1, denimColor8Bit);
|
||||
buffer.setLED(2, Color.kFirstRed);
|
||||
buffer.setLED(3, Color.kFirstBlue);
|
||||
buffer.setLED(2, Color.FIRST_RED);
|
||||
buffer.setLED(3, Color.FIRST_BLUE);
|
||||
|
||||
assertEquals(Color.kFirstBlue, buffer.getLED(0));
|
||||
assertEquals(Color.kDenim, buffer.getLED(1));
|
||||
assertEquals(Color.kFirstRed, buffer.getLED(2));
|
||||
assertEquals(Color.kFirstBlue, buffer.getLED(3));
|
||||
assertEquals(Color.FIRST_BLUE, buffer.getLED(0));
|
||||
assertEquals(Color.DENIM, buffer.getLED(1));
|
||||
assertEquals(Color.FIRST_RED, buffer.getLED(2));
|
||||
assertEquals(Color.FIRST_BLUE, buffer.getLED(3));
|
||||
assertEquals(firstBlueColor8Bit, buffer.getLED8Bit(0));
|
||||
assertEquals(denimColor8Bit, buffer.getLED8Bit(1));
|
||||
assertEquals(firstRedColor8Bit, buffer.getLED8Bit(2));
|
||||
|
||||
@@ -14,7 +14,7 @@ class AddressableLEDBufferViewTest {
|
||||
void singleLED() {
|
||||
var buffer = new AddressableLEDBuffer(10);
|
||||
var view = new AddressableLEDBufferView(buffer, 5, 5);
|
||||
var color = Color.kAqua;
|
||||
var color = Color.AQUA;
|
||||
view.setLED(0, color);
|
||||
assertEquals(color, buffer.getLED(5));
|
||||
assertEquals(color, view.getLED(0));
|
||||
@@ -24,11 +24,11 @@ class AddressableLEDBufferViewTest {
|
||||
void segment() {
|
||||
var buffer = new AddressableLEDBuffer(10);
|
||||
var view = new AddressableLEDBufferView(buffer, 2, 8);
|
||||
view.setLED(0, Color.kAqua);
|
||||
assertEquals(Color.kAqua, buffer.getLED(2));
|
||||
view.setLED(0, Color.AQUA);
|
||||
assertEquals(Color.AQUA, buffer.getLED(2));
|
||||
|
||||
view.setLED(6, Color.kAzure);
|
||||
assertEquals(Color.kAzure, buffer.getLED(8));
|
||||
view.setLED(6, Color.AZURE);
|
||||
assertEquals(Color.AZURE, buffer.getLED(8));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -37,33 +37,33 @@ class AddressableLEDBufferViewTest {
|
||||
var view = new AddressableLEDBufferView(buffer, 8, 2);
|
||||
|
||||
// LED 0 in the view should write to LED 8 on the real buffer
|
||||
view.setLED(0, Color.kAqua);
|
||||
assertEquals(Color.kAqua, buffer.getLED(8));
|
||||
view.setLED(0, Color.AQUA);
|
||||
assertEquals(Color.AQUA, buffer.getLED(8));
|
||||
|
||||
// .. and LED 6 in the view should write to LED 2 on the real buffer
|
||||
view.setLED(6, Color.kAzure);
|
||||
assertEquals(Color.kAzure, buffer.getLED(2));
|
||||
view.setLED(6, Color.AZURE);
|
||||
assertEquals(Color.AZURE, buffer.getLED(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
void fullManualReversed() {
|
||||
var buffer = new AddressableLEDBuffer(10);
|
||||
var view = new AddressableLEDBufferView(buffer, 9, 0);
|
||||
view.setLED(0, Color.kWhite);
|
||||
assertEquals(Color.kWhite, buffer.getLED(9));
|
||||
view.setLED(0, Color.WHITE);
|
||||
assertEquals(Color.WHITE, buffer.getLED(9));
|
||||
|
||||
buffer.setLED(8, Color.kRed);
|
||||
assertEquals(Color.kRed, view.getLED(1));
|
||||
buffer.setLED(8, Color.RED);
|
||||
assertEquals(Color.RED, view.getLED(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
void reversed() {
|
||||
var buffer = new AddressableLEDBuffer(10);
|
||||
var view = new AddressableLEDBufferView(buffer, 0, 9).reversed();
|
||||
view.setLED(0, Color.kWhite);
|
||||
assertEquals(Color.kWhite, buffer.getLED(9));
|
||||
view.setLED(0, Color.WHITE);
|
||||
assertEquals(Color.WHITE, buffer.getLED(9));
|
||||
|
||||
view.setLED(9, Color.kRed);
|
||||
assertEquals(Color.kRed, buffer.getLED(0));
|
||||
view.setLED(9, Color.RED);
|
||||
assertEquals(Color.RED, buffer.getLED(0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,16 +16,17 @@ import static org.wpilib.units.Units.Microseconds;
|
||||
import static org.wpilib.units.Units.Percent;
|
||||
import static org.wpilib.units.Units.Seconds;
|
||||
import static org.wpilib.units.Units.Value;
|
||||
import static org.wpilib.util.Color.kBlack;
|
||||
import static org.wpilib.util.Color.kBlue;
|
||||
import static org.wpilib.util.Color.kGreen;
|
||||
import static org.wpilib.util.Color.kLime;
|
||||
import static org.wpilib.util.Color.kMagenta;
|
||||
import static org.wpilib.util.Color.kMidnightBlue;
|
||||
import static org.wpilib.util.Color.kPurple;
|
||||
import static org.wpilib.util.Color.kRed;
|
||||
import static org.wpilib.util.Color.kWhite;
|
||||
import static org.wpilib.util.Color.kYellow;
|
||||
import static org.wpilib.util.Color.BLACK;
|
||||
import static org.wpilib.util.Color.BLUE;
|
||||
import static org.wpilib.util.Color.GREEN;
|
||||
import static org.wpilib.util.Color.LIME;
|
||||
import static org.wpilib.util.Color.MAGENTA;
|
||||
import static org.wpilib.util.Color.MIDNIGHT_BLUE;
|
||||
import static org.wpilib.util.Color.PURPLE;
|
||||
import static org.wpilib.util.Color.RED;
|
||||
import static org.wpilib.util.Color.ROSY_BROWN;
|
||||
import static org.wpilib.util.Color.WHITE;
|
||||
import static org.wpilib.util.Color.YELLOW;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@@ -46,13 +47,13 @@ class LEDPatternTest {
|
||||
for (int led = 0; led < reader.getLength(); led++) {
|
||||
switch (led % 3) {
|
||||
case 0:
|
||||
writer.setLED(led, kWhite);
|
||||
writer.setLED(led, WHITE);
|
||||
break;
|
||||
case 1:
|
||||
writer.setLED(led, kYellow);
|
||||
writer.setLED(led, YELLOW);
|
||||
break;
|
||||
case 2:
|
||||
writer.setLED(led, kPurple);
|
||||
writer.setLED(led, PURPLE);
|
||||
break;
|
||||
default:
|
||||
fail("Bad test setup");
|
||||
@@ -74,12 +75,12 @@ class LEDPatternTest {
|
||||
|
||||
@Test
|
||||
void solidColor() {
|
||||
LEDPattern pattern = LEDPattern.solid(kYellow);
|
||||
LEDPattern pattern = LEDPattern.solid(YELLOW);
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(99);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
for (int i = 0; i < buffer.getLength(); i++) {
|
||||
assertEquals(kYellow, buffer.getLED(i));
|
||||
assertEquals(YELLOW, buffer.getLED(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,74 +95,74 @@ class LEDPatternTest {
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
for (int i = 0; i < buffer.getLength(); i++) {
|
||||
assertEquals(kBlack, buffer.getLED(i));
|
||||
assertEquals(BLACK, buffer.getLED(i));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void gradient1SetsToSolid() {
|
||||
LEDPattern pattern = LEDPattern.gradient(kContinuous, kYellow);
|
||||
LEDPattern pattern = LEDPattern.gradient(kContinuous, YELLOW);
|
||||
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(99);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
for (int i = 0; i < buffer.getLength(); i++) {
|
||||
assertEquals(kYellow, buffer.getLED(i));
|
||||
assertEquals(YELLOW, buffer.getLED(i));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void continuousGradient2Colors() {
|
||||
LEDPattern pattern = LEDPattern.gradient(kContinuous, kYellow, kPurple);
|
||||
LEDPattern pattern = LEDPattern.gradient(kContinuous, YELLOW, PURPLE);
|
||||
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(99);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kYellow, buffer.getLED(0));
|
||||
assertColorEquals(Color.lerpRGB(kYellow, kPurple, 25 / 49.0), buffer.getLED(25));
|
||||
assertColorEquals(kPurple, buffer.getLED(49));
|
||||
assertColorEquals(Color.lerpRGB(kYellow, kPurple, 25 / 49.0), buffer.getLED(73));
|
||||
assertColorEquals(kYellow, buffer.getLED(98));
|
||||
assertColorEquals(YELLOW, buffer.getLED(0));
|
||||
assertColorEquals(Color.lerpRGB(YELLOW, PURPLE, 25 / 49.0), buffer.getLED(25));
|
||||
assertColorEquals(PURPLE, buffer.getLED(49));
|
||||
assertColorEquals(Color.lerpRGB(YELLOW, PURPLE, 25 / 49.0), buffer.getLED(73));
|
||||
assertColorEquals(YELLOW, buffer.getLED(98));
|
||||
}
|
||||
|
||||
@Test
|
||||
void discontinuousGradient2Colors() {
|
||||
LEDPattern pattern = LEDPattern.gradient(kDiscontinuous, kYellow, kPurple);
|
||||
LEDPattern pattern = LEDPattern.gradient(kDiscontinuous, YELLOW, PURPLE);
|
||||
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(99);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kYellow, buffer.getLED(0));
|
||||
assertColorEquals(Color.lerpRGB(kYellow, kPurple, 0.5), buffer.getLED(49));
|
||||
assertColorEquals(kPurple, buffer.getLED(98));
|
||||
assertColorEquals(YELLOW, buffer.getLED(0));
|
||||
assertColorEquals(Color.lerpRGB(YELLOW, PURPLE, 0.5), buffer.getLED(49));
|
||||
assertColorEquals(PURPLE, buffer.getLED(98));
|
||||
}
|
||||
|
||||
@Test
|
||||
void gradient3Colors() {
|
||||
LEDPattern pattern = LEDPattern.gradient(kContinuous, kYellow, kPurple, kWhite);
|
||||
LEDPattern pattern = LEDPattern.gradient(kContinuous, YELLOW, PURPLE, WHITE);
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(99);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kYellow, buffer.getLED(0));
|
||||
assertColorEquals(Color.lerpRGB(kYellow, kPurple, 25.0 / 33.0), buffer.getLED(25));
|
||||
assertColorEquals(kPurple, buffer.getLED(33));
|
||||
assertColorEquals(Color.lerpRGB(kPurple, kWhite, 25.0 / 33.0), buffer.getLED(58));
|
||||
assertColorEquals(kWhite, buffer.getLED(66));
|
||||
assertColorEquals(Color.lerpRGB(kWhite, kYellow, 25.0 / 33.0), buffer.getLED(91));
|
||||
assertColorEquals(Color.lerpRGB(kWhite, kYellow, 32.0 / 33.0), buffer.getLED(98));
|
||||
assertColorEquals(YELLOW, buffer.getLED(0));
|
||||
assertColorEquals(Color.lerpRGB(YELLOW, PURPLE, 25.0 / 33.0), buffer.getLED(25));
|
||||
assertColorEquals(PURPLE, buffer.getLED(33));
|
||||
assertColorEquals(Color.lerpRGB(PURPLE, WHITE, 25.0 / 33.0), buffer.getLED(58));
|
||||
assertColorEquals(WHITE, buffer.getLED(66));
|
||||
assertColorEquals(Color.lerpRGB(WHITE, YELLOW, 25.0 / 33.0), buffer.getLED(91));
|
||||
assertColorEquals(Color.lerpRGB(WHITE, YELLOW, 32.0 / 33.0), buffer.getLED(98));
|
||||
}
|
||||
|
||||
@Test
|
||||
void discontinuousGradient3Colors() {
|
||||
LEDPattern pattern = LEDPattern.gradient(kDiscontinuous, kYellow, kPurple, kWhite);
|
||||
LEDPattern pattern = LEDPattern.gradient(kDiscontinuous, YELLOW, PURPLE, WHITE);
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(101);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kYellow, buffer.getLED(0));
|
||||
assertColorEquals(Color.lerpRGB(kYellow, kPurple, 0.5), buffer.getLED(25));
|
||||
assertColorEquals(kPurple, buffer.getLED(50));
|
||||
assertColorEquals(Color.lerpRGB(kPurple, kWhite, 0.5), buffer.getLED(75));
|
||||
assertColorEquals(kWhite, buffer.getLED(100));
|
||||
assertColorEquals(YELLOW, buffer.getLED(0));
|
||||
assertColorEquals(Color.lerpRGB(YELLOW, PURPLE, 0.5), buffer.getLED(25));
|
||||
assertColorEquals(PURPLE, buffer.getLED(50));
|
||||
assertColorEquals(Color.lerpRGB(PURPLE, WHITE, 0.5), buffer.getLED(75));
|
||||
assertColorEquals(WHITE, buffer.getLED(100));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -175,36 +176,36 @@ class LEDPatternTest {
|
||||
|
||||
pattern.applyTo(buffer);
|
||||
for (int i = 0; i < 99; i++) {
|
||||
assertColorEquals(kBlack, buffer.getLED(i));
|
||||
assertColorEquals(BLACK, buffer.getLED(i));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void step1SetsToSolid() {
|
||||
LEDPattern pattern = LEDPattern.steps(Map.of(0.0, kYellow));
|
||||
LEDPattern pattern = LEDPattern.steps(Map.of(0.0, YELLOW));
|
||||
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(99);
|
||||
|
||||
pattern.applyTo(buffer);
|
||||
for (int i = 0; i < 99; i++) {
|
||||
assertColorEquals(kYellow, buffer.getLED(i));
|
||||
assertColorEquals(YELLOW, buffer.getLED(i));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void step1HalfSetsToHalfOffHalfColor() {
|
||||
LEDPattern pattern = LEDPattern.steps(Map.of(0.50, kYellow));
|
||||
LEDPattern pattern = LEDPattern.steps(Map.of(0.50, YELLOW));
|
||||
|
||||
AddressableLEDBuffer buffer = new AddressableLEDBuffer(99);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
// [0, 48] should be black...
|
||||
for (int i = 0; i < 49; i++) {
|
||||
assertColorEquals(kBlack, buffer.getLED(i));
|
||||
assertColorEquals(BLACK, buffer.getLED(i));
|
||||
}
|
||||
// ... and [49, <end>] should be the color that was set
|
||||
for (int i = 49; i < buffer.getLength(); i++) {
|
||||
assertColorEquals(kYellow, buffer.getLED(i));
|
||||
assertColorEquals(YELLOW, buffer.getLED(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,11 +429,11 @@ class LEDPatternTest {
|
||||
void reverseSolid() {
|
||||
var buffer = new AddressableLEDBuffer(90);
|
||||
|
||||
var pattern = LEDPattern.solid(Color.kRosyBrown).reversed();
|
||||
var pattern = LEDPattern.solid(ROSY_BROWN).reversed();
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
for (int led = 0; led < buffer.getLength(); led++) {
|
||||
assertColorEquals(Color.kRosyBrown, buffer.getLED(led));
|
||||
assertColorEquals(ROSY_BROWN, buffer.getLED(led));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,15 +441,15 @@ class LEDPatternTest {
|
||||
void reverseSteps() {
|
||||
var buffer = new AddressableLEDBuffer(100);
|
||||
|
||||
var pattern = LEDPattern.steps(Map.of(0, kWhite, 0.5, kYellow)).reversed();
|
||||
var pattern = LEDPattern.steps(Map.of(0, WHITE, 0.5, YELLOW)).reversed();
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
// colors should be swapped; yellow first, then white
|
||||
for (int led = 0; led < buffer.getLength(); led++) {
|
||||
if (led < 50) {
|
||||
assertColorEquals(kYellow, buffer.getLED(led));
|
||||
assertColorEquals(YELLOW, buffer.getLED(led));
|
||||
} else {
|
||||
assertColorEquals(kWhite, buffer.getLED(led));
|
||||
assertColorEquals(WHITE, buffer.getLED(led));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -465,13 +466,13 @@ class LEDPatternTest {
|
||||
Color color = buffer.getLED(led);
|
||||
switch (led % 3) {
|
||||
case 0:
|
||||
assertColorEquals(kPurple, color);
|
||||
assertColorEquals(PURPLE, color);
|
||||
break;
|
||||
case 1:
|
||||
assertColorEquals(kWhite, color);
|
||||
assertColorEquals(WHITE, color);
|
||||
break;
|
||||
case 2:
|
||||
assertColorEquals(kYellow, color);
|
||||
assertColorEquals(YELLOW, color);
|
||||
break;
|
||||
default:
|
||||
fail("Bad test setup");
|
||||
@@ -492,13 +493,13 @@ class LEDPatternTest {
|
||||
Color color = buffer.getLED(led);
|
||||
switch (led % 3) {
|
||||
case 0:
|
||||
assertColorEquals(kYellow, color);
|
||||
assertColorEquals(YELLOW, color);
|
||||
break;
|
||||
case 1:
|
||||
assertColorEquals(kPurple, color);
|
||||
assertColorEquals(PURPLE, color);
|
||||
break;
|
||||
case 2:
|
||||
assertColorEquals(kWhite, color);
|
||||
assertColorEquals(WHITE, color);
|
||||
break;
|
||||
default:
|
||||
fail("Bad test setup");
|
||||
@@ -519,13 +520,13 @@ class LEDPatternTest {
|
||||
Color color = buffer.getLED(led);
|
||||
switch (led % 3) {
|
||||
case 0:
|
||||
assertColorEquals(kWhite, color);
|
||||
assertColorEquals(WHITE, color);
|
||||
break;
|
||||
case 1:
|
||||
assertColorEquals(kYellow, color);
|
||||
assertColorEquals(YELLOW, color);
|
||||
break;
|
||||
case 2:
|
||||
assertColorEquals(kPurple, color);
|
||||
assertColorEquals(PURPLE, color);
|
||||
break;
|
||||
default:
|
||||
fail("Bad test setup");
|
||||
@@ -537,7 +538,7 @@ class LEDPatternTest {
|
||||
@Test
|
||||
void blinkSymmetric() {
|
||||
// on for 2 seconds, off for 2 seconds
|
||||
var pattern = LEDPattern.solid(kWhite).blink(Seconds.of(2));
|
||||
var pattern = LEDPattern.solid(WHITE).blink(Seconds.of(2));
|
||||
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
|
||||
@@ -551,13 +552,13 @@ class LEDPatternTest {
|
||||
case 1:
|
||||
case 4:
|
||||
case 5:
|
||||
assertColorEquals(kWhite, color);
|
||||
assertColorEquals(WHITE, color);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 6:
|
||||
case 7:
|
||||
assertColorEquals(kBlack, color);
|
||||
assertColorEquals(BLACK, color);
|
||||
break;
|
||||
default:
|
||||
fail("Bad test setup");
|
||||
@@ -569,7 +570,7 @@ class LEDPatternTest {
|
||||
@Test
|
||||
void blinkAsymmetric() {
|
||||
// on for 3 seconds, off for 1 second
|
||||
var pattern = LEDPattern.solid(kWhite).blink(Seconds.of(3), Seconds.of(1));
|
||||
var pattern = LEDPattern.solid(WHITE).blink(Seconds.of(3), Seconds.of(1));
|
||||
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
|
||||
@@ -585,11 +586,11 @@ class LEDPatternTest {
|
||||
case 4:
|
||||
case 5:
|
||||
case 6: // second period
|
||||
assertColorEquals(kWhite, color);
|
||||
assertColorEquals(WHITE, color);
|
||||
break;
|
||||
case 3:
|
||||
case 7:
|
||||
assertColorEquals(kBlack, color);
|
||||
assertColorEquals(BLACK, color);
|
||||
break;
|
||||
default:
|
||||
fail("Bad test setup");
|
||||
@@ -601,34 +602,34 @@ class LEDPatternTest {
|
||||
@Test
|
||||
void blinkInSync() {
|
||||
AtomicBoolean condition = new AtomicBoolean(false);
|
||||
var pattern = LEDPattern.solid(kWhite).synchronizedBlink(condition::get);
|
||||
var pattern = LEDPattern.solid(WHITE).synchronizedBlink(condition::get);
|
||||
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
|
||||
condition.set(true);
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kWhite, buffer.getLED(0));
|
||||
assertColorEquals(WHITE, buffer.getLED(0));
|
||||
|
||||
condition.set(false);
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void breathe() {
|
||||
final Color midGray = new Color(0.5, 0.5, 0.5);
|
||||
|
||||
var pattern = LEDPattern.solid(kWhite).breathe(Microseconds.of(4));
|
||||
var pattern = LEDPattern.solid(WHITE).breathe(Microseconds.of(4));
|
||||
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
|
||||
{
|
||||
m_mockTime = 0; // start
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kWhite, buffer.getLED(0));
|
||||
assertColorEquals(WHITE, buffer.getLED(0));
|
||||
}
|
||||
|
||||
{
|
||||
@@ -640,7 +641,7 @@ class LEDPatternTest {
|
||||
{
|
||||
m_mockTime = 2; // bottom
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
}
|
||||
|
||||
{
|
||||
@@ -652,24 +653,24 @@ class LEDPatternTest {
|
||||
{
|
||||
m_mockTime = 4; // back to start
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kWhite, buffer.getLED(0));
|
||||
assertColorEquals(WHITE, buffer.getLED(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void overlaySolidOnSolid() {
|
||||
var overlay = LEDPattern.solid(kYellow).overlayOn(LEDPattern.solid(kWhite));
|
||||
var overlay = LEDPattern.solid(YELLOW).overlayOn(LEDPattern.solid(WHITE));
|
||||
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
overlay.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kYellow, buffer.getLED(0));
|
||||
assertColorEquals(YELLOW, buffer.getLED(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void overlayNearlyBlack() {
|
||||
Color overlayColor = new Color(new Color8Bit(1, 0, 0));
|
||||
var overlay = LEDPattern.solid(overlayColor).overlayOn(LEDPattern.solid(kWhite));
|
||||
var overlay = LEDPattern.solid(overlayColor).overlayOn(LEDPattern.solid(WHITE));
|
||||
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
overlay.applyTo(buffer);
|
||||
@@ -680,19 +681,19 @@ class LEDPatternTest {
|
||||
@Test
|
||||
void overlayMixed() {
|
||||
var overlay =
|
||||
LEDPattern.steps(Map.of(0, kYellow, 0.5, kBlack)).overlayOn(LEDPattern.solid(kWhite));
|
||||
LEDPattern.steps(Map.of(0, YELLOW, 0.5, BLACK)).overlayOn(LEDPattern.solid(WHITE));
|
||||
|
||||
var buffer = new AddressableLEDBuffer(2);
|
||||
overlay.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kYellow, buffer.getLED(0));
|
||||
assertColorEquals(kWhite, buffer.getLED(1));
|
||||
assertColorEquals(YELLOW, buffer.getLED(0));
|
||||
assertColorEquals(WHITE, buffer.getLED(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
void blend() {
|
||||
var pattern1 = LEDPattern.solid(kBlue);
|
||||
var pattern2 = LEDPattern.solid(kRed);
|
||||
var pattern1 = LEDPattern.solid(BLUE);
|
||||
var pattern2 = LEDPattern.solid(RED);
|
||||
var blend = pattern1.blend(pattern2);
|
||||
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
@@ -707,7 +708,7 @@ class LEDPatternTest {
|
||||
Color color = new Color(123, 123, 123);
|
||||
var base = LEDPattern.solid(color);
|
||||
// first 50% mask on, last 50% mask off
|
||||
var mask = LEDPattern.steps(Map.of(0, kWhite, 0.5, kBlack));
|
||||
var mask = LEDPattern.steps(Map.of(0, WHITE, 0.5, BLACK));
|
||||
var masked = base.mask(mask);
|
||||
|
||||
var buffer = new AddressableLEDBuffer(10);
|
||||
@@ -718,7 +719,7 @@ class LEDPatternTest {
|
||||
}
|
||||
|
||||
for (int i = 5; i < 10; i++) {
|
||||
assertColorEquals(kBlack, buffer.getLED(i));
|
||||
assertColorEquals(BLACK, buffer.getLED(i));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,8 +729,7 @@ class LEDPatternTest {
|
||||
Color halfGray = new Color(0.5, 0.5, 0.5);
|
||||
var base = LEDPattern.solid(baseColor);
|
||||
|
||||
var mask =
|
||||
LEDPattern.steps(Map.of(0, kRed, 0.2, kLime, 0.4, kBlue, 0.6, halfGray, 0.8, kWhite));
|
||||
var mask = LEDPattern.steps(Map.of(0, RED, 0.2, LIME, 0.4, BLUE, 0.6, halfGray, 0.8, WHITE));
|
||||
|
||||
var masked = base.mask(mask);
|
||||
|
||||
@@ -759,14 +759,14 @@ class LEDPatternTest {
|
||||
int lastMaskedLED = (int) (t * 100);
|
||||
for (int i = 0; i < lastMaskedLED; i++) {
|
||||
assertColorEquals(
|
||||
kWhite,
|
||||
WHITE,
|
||||
buffer.getLED(i),
|
||||
"Progress " + lastMaskedLED + "%, LED " + i + " should be WHITE");
|
||||
}
|
||||
|
||||
for (int i = lastMaskedLED; i < 100; i++) {
|
||||
assertColorEquals(
|
||||
kBlack,
|
||||
BLACK,
|
||||
buffer.getLED(i),
|
||||
"Progress " + lastMaskedLED + "% , LED " + i + " should be BLACK");
|
||||
}
|
||||
@@ -775,87 +775,87 @@ class LEDPatternTest {
|
||||
|
||||
@Test
|
||||
void zeroBrightness() {
|
||||
var pattern = LEDPattern.solid(kRed).atBrightness(Percent.of(0));
|
||||
var pattern = LEDPattern.solid(RED).atBrightness(Percent.of(0));
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void sameBrightness() {
|
||||
var pattern = LEDPattern.solid(kMagenta).atBrightness(Percent.of(100));
|
||||
var pattern = LEDPattern.solid(MAGENTA).atBrightness(Percent.of(100));
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kMagenta, buffer.getLED(0));
|
||||
assertColorEquals(MAGENTA, buffer.getLED(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void higherBrightness() {
|
||||
var pattern = LEDPattern.solid(kMagenta).atBrightness(Value.of(4 / 3.0));
|
||||
var pattern = LEDPattern.solid(MAGENTA).atBrightness(Value.of(4 / 3.0));
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kMagenta, buffer.getLED(0));
|
||||
assertColorEquals(MAGENTA, buffer.getLED(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void negativeBrightness() {
|
||||
var pattern = LEDPattern.solid(kWhite).atBrightness(Percent.of(-1000));
|
||||
var pattern = LEDPattern.solid(WHITE).atBrightness(Percent.of(-1000));
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void clippingBrightness() {
|
||||
var pattern = LEDPattern.solid(kMidnightBlue).atBrightness(Percent.of(10000));
|
||||
var pattern = LEDPattern.solid(MIDNIGHT_BLUE).atBrightness(Percent.of(10000));
|
||||
var buffer = new AddressableLEDBuffer(1);
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kWhite, buffer.getLED(0));
|
||||
assertColorEquals(WHITE, buffer.getLED(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void reverseMask() {
|
||||
var pattern =
|
||||
LEDPattern.steps(Map.of(0, kRed, 0.25, kBlue, 0.5, kYellow, 0.75, kGreen))
|
||||
.mask(LEDPattern.steps(Map.of(0, kWhite, 0.5, kBlack)))
|
||||
LEDPattern.steps(Map.of(0, RED, 0.25, BLUE, 0.5, YELLOW, 0.75, GREEN))
|
||||
.mask(LEDPattern.steps(Map.of(0, WHITE, 0.5, BLACK)))
|
||||
.reversed();
|
||||
var buffer = new AddressableLEDBuffer(8);
|
||||
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kRed, buffer.getLED(7));
|
||||
assertColorEquals(kRed, buffer.getLED(6));
|
||||
assertColorEquals(kBlue, buffer.getLED(5));
|
||||
assertColorEquals(kBlue, buffer.getLED(4));
|
||||
assertColorEquals(kBlack, buffer.getLED(3));
|
||||
assertColorEquals(kBlack, buffer.getLED(2));
|
||||
assertColorEquals(kBlack, buffer.getLED(1));
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(RED, buffer.getLED(7));
|
||||
assertColorEquals(RED, buffer.getLED(6));
|
||||
assertColorEquals(BLUE, buffer.getLED(5));
|
||||
assertColorEquals(BLUE, buffer.getLED(4));
|
||||
assertColorEquals(BLACK, buffer.getLED(3));
|
||||
assertColorEquals(BLACK, buffer.getLED(2));
|
||||
assertColorEquals(BLACK, buffer.getLED(1));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
void offsetMask() {
|
||||
var pattern =
|
||||
LEDPattern.steps(Map.of(0, kRed, 0.25, kBlue, 0.5, kYellow, 0.75, kGreen))
|
||||
.mask(LEDPattern.steps(Map.of(0, kWhite, 0.5, kBlack)))
|
||||
LEDPattern.steps(Map.of(0, RED, 0.25, BLUE, 0.5, YELLOW, 0.75, GREEN))
|
||||
.mask(LEDPattern.steps(Map.of(0, WHITE, 0.5, BLACK)))
|
||||
.offsetBy(4);
|
||||
var buffer = new AddressableLEDBuffer(8);
|
||||
|
||||
pattern.applyTo(buffer);
|
||||
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(kBlack, buffer.getLED(1));
|
||||
assertColorEquals(kBlack, buffer.getLED(2));
|
||||
assertColorEquals(kBlack, buffer.getLED(3));
|
||||
assertColorEquals(kRed, buffer.getLED(4));
|
||||
assertColorEquals(kRed, buffer.getLED(5));
|
||||
assertColorEquals(kBlue, buffer.getLED(6));
|
||||
assertColorEquals(kBlue, buffer.getLED(7));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(1));
|
||||
assertColorEquals(BLACK, buffer.getLED(2));
|
||||
assertColorEquals(BLACK, buffer.getLED(3));
|
||||
assertColorEquals(RED, buffer.getLED(4));
|
||||
assertColorEquals(RED, buffer.getLED(5));
|
||||
assertColorEquals(BLUE, buffer.getLED(6));
|
||||
assertColorEquals(BLUE, buffer.getLED(7));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -865,61 +865,61 @@ class LEDPatternTest {
|
||||
// [red, red, blue, blue, black, black, black, black]
|
||||
// all scrolling at 1 LED per microsecond
|
||||
var pattern =
|
||||
LEDPattern.steps(Map.of(0, kRed, 0.25, kBlue, 0.5, kYellow, 0.75, kGreen))
|
||||
.mask(LEDPattern.steps(Map.of(0, kWhite, 0.5, kBlack)))
|
||||
LEDPattern.steps(Map.of(0, RED, 0.25, BLUE, 0.5, YELLOW, 0.75, GREEN))
|
||||
.mask(LEDPattern.steps(Map.of(0, WHITE, 0.5, BLACK)))
|
||||
.scrollAtRelativeVelocity(Percent.per(Microsecond).of(12.5));
|
||||
var buffer = new AddressableLEDBuffer(8);
|
||||
|
||||
{
|
||||
m_mockTime = 0; // start
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kRed, buffer.getLED(0));
|
||||
assertColorEquals(kRed, buffer.getLED(1));
|
||||
assertColorEquals(kBlue, buffer.getLED(2));
|
||||
assertColorEquals(kBlue, buffer.getLED(3));
|
||||
assertColorEquals(kBlack, buffer.getLED(4));
|
||||
assertColorEquals(kBlack, buffer.getLED(5));
|
||||
assertColorEquals(kBlack, buffer.getLED(6));
|
||||
assertColorEquals(kBlack, buffer.getLED(7));
|
||||
assertColorEquals(RED, buffer.getLED(0));
|
||||
assertColorEquals(RED, buffer.getLED(1));
|
||||
assertColorEquals(BLUE, buffer.getLED(2));
|
||||
assertColorEquals(BLUE, buffer.getLED(3));
|
||||
assertColorEquals(BLACK, buffer.getLED(4));
|
||||
assertColorEquals(BLACK, buffer.getLED(5));
|
||||
assertColorEquals(BLACK, buffer.getLED(6));
|
||||
assertColorEquals(BLACK, buffer.getLED(7));
|
||||
}
|
||||
|
||||
{
|
||||
m_mockTime = 1;
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(kRed, buffer.getLED(1));
|
||||
assertColorEquals(kRed, buffer.getLED(2));
|
||||
assertColorEquals(kBlue, buffer.getLED(3));
|
||||
assertColorEquals(kBlue, buffer.getLED(4));
|
||||
assertColorEquals(kBlack, buffer.getLED(5));
|
||||
assertColorEquals(kBlack, buffer.getLED(6));
|
||||
assertColorEquals(kBlack, buffer.getLED(7));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
assertColorEquals(RED, buffer.getLED(1));
|
||||
assertColorEquals(RED, buffer.getLED(2));
|
||||
assertColorEquals(BLUE, buffer.getLED(3));
|
||||
assertColorEquals(BLUE, buffer.getLED(4));
|
||||
assertColorEquals(BLACK, buffer.getLED(5));
|
||||
assertColorEquals(BLACK, buffer.getLED(6));
|
||||
assertColorEquals(BLACK, buffer.getLED(7));
|
||||
}
|
||||
|
||||
{
|
||||
m_mockTime = 2;
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(kBlack, buffer.getLED(1));
|
||||
assertColorEquals(kRed, buffer.getLED(2));
|
||||
assertColorEquals(kRed, buffer.getLED(3));
|
||||
assertColorEquals(kBlue, buffer.getLED(4));
|
||||
assertColorEquals(kBlue, buffer.getLED(5));
|
||||
assertColorEquals(kBlack, buffer.getLED(6));
|
||||
assertColorEquals(kBlack, buffer.getLED(7));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(1));
|
||||
assertColorEquals(RED, buffer.getLED(2));
|
||||
assertColorEquals(RED, buffer.getLED(3));
|
||||
assertColorEquals(BLUE, buffer.getLED(4));
|
||||
assertColorEquals(BLUE, buffer.getLED(5));
|
||||
assertColorEquals(BLACK, buffer.getLED(6));
|
||||
assertColorEquals(BLACK, buffer.getLED(7));
|
||||
}
|
||||
|
||||
{
|
||||
m_mockTime = 3;
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(kBlack, buffer.getLED(1));
|
||||
assertColorEquals(kBlack, buffer.getLED(2));
|
||||
assertColorEquals(kRed, buffer.getLED(3));
|
||||
assertColorEquals(kRed, buffer.getLED(4));
|
||||
assertColorEquals(kBlue, buffer.getLED(5));
|
||||
assertColorEquals(kBlue, buffer.getLED(6));
|
||||
assertColorEquals(kBlack, buffer.getLED(7));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(1));
|
||||
assertColorEquals(BLACK, buffer.getLED(2));
|
||||
assertColorEquals(RED, buffer.getLED(3));
|
||||
assertColorEquals(RED, buffer.getLED(4));
|
||||
assertColorEquals(BLUE, buffer.getLED(5));
|
||||
assertColorEquals(BLUE, buffer.getLED(6));
|
||||
assertColorEquals(BLACK, buffer.getLED(7));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -930,61 +930,61 @@ class LEDPatternTest {
|
||||
// [red, red, blue, blue, black, black, black, black]
|
||||
// all scrolling at 1 LED per microsecond
|
||||
var pattern =
|
||||
LEDPattern.steps(Map.of(0, kRed, 0.25, kBlue, 0.5, kYellow, 0.75, kGreen))
|
||||
.mask(LEDPattern.steps(Map.of(0, kWhite, 0.5, kBlack)))
|
||||
LEDPattern.steps(Map.of(0, RED, 0.25, BLUE, 0.5, YELLOW, 0.75, GREEN))
|
||||
.mask(LEDPattern.steps(Map.of(0, WHITE, 0.5, BLACK)))
|
||||
.scrollAtAbsoluteVelocity(Meters.per(Microsecond).of(1), Meters.one());
|
||||
var buffer = new AddressableLEDBuffer(8);
|
||||
|
||||
{
|
||||
m_mockTime = 0; // start
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kRed, buffer.getLED(0));
|
||||
assertColorEquals(kRed, buffer.getLED(1));
|
||||
assertColorEquals(kBlue, buffer.getLED(2));
|
||||
assertColorEquals(kBlue, buffer.getLED(3));
|
||||
assertColorEquals(kBlack, buffer.getLED(4));
|
||||
assertColorEquals(kBlack, buffer.getLED(5));
|
||||
assertColorEquals(kBlack, buffer.getLED(6));
|
||||
assertColorEquals(kBlack, buffer.getLED(7));
|
||||
assertColorEquals(RED, buffer.getLED(0));
|
||||
assertColorEquals(RED, buffer.getLED(1));
|
||||
assertColorEquals(BLUE, buffer.getLED(2));
|
||||
assertColorEquals(BLUE, buffer.getLED(3));
|
||||
assertColorEquals(BLACK, buffer.getLED(4));
|
||||
assertColorEquals(BLACK, buffer.getLED(5));
|
||||
assertColorEquals(BLACK, buffer.getLED(6));
|
||||
assertColorEquals(BLACK, buffer.getLED(7));
|
||||
}
|
||||
|
||||
{
|
||||
m_mockTime = 1;
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(kRed, buffer.getLED(1));
|
||||
assertColorEquals(kRed, buffer.getLED(2));
|
||||
assertColorEquals(kBlue, buffer.getLED(3));
|
||||
assertColorEquals(kBlue, buffer.getLED(4));
|
||||
assertColorEquals(kBlack, buffer.getLED(5));
|
||||
assertColorEquals(kBlack, buffer.getLED(6));
|
||||
assertColorEquals(kBlack, buffer.getLED(7));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
assertColorEquals(RED, buffer.getLED(1));
|
||||
assertColorEquals(RED, buffer.getLED(2));
|
||||
assertColorEquals(BLUE, buffer.getLED(3));
|
||||
assertColorEquals(BLUE, buffer.getLED(4));
|
||||
assertColorEquals(BLACK, buffer.getLED(5));
|
||||
assertColorEquals(BLACK, buffer.getLED(6));
|
||||
assertColorEquals(BLACK, buffer.getLED(7));
|
||||
}
|
||||
|
||||
{
|
||||
m_mockTime = 2;
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(kBlack, buffer.getLED(1));
|
||||
assertColorEquals(kRed, buffer.getLED(2));
|
||||
assertColorEquals(kRed, buffer.getLED(3));
|
||||
assertColorEquals(kBlue, buffer.getLED(4));
|
||||
assertColorEquals(kBlue, buffer.getLED(5));
|
||||
assertColorEquals(kBlack, buffer.getLED(6));
|
||||
assertColorEquals(kBlack, buffer.getLED(7));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(1));
|
||||
assertColorEquals(RED, buffer.getLED(2));
|
||||
assertColorEquals(RED, buffer.getLED(3));
|
||||
assertColorEquals(BLUE, buffer.getLED(4));
|
||||
assertColorEquals(BLUE, buffer.getLED(5));
|
||||
assertColorEquals(BLACK, buffer.getLED(6));
|
||||
assertColorEquals(BLACK, buffer.getLED(7));
|
||||
}
|
||||
|
||||
{
|
||||
m_mockTime = 3;
|
||||
pattern.applyTo(buffer);
|
||||
assertColorEquals(kBlack, buffer.getLED(0));
|
||||
assertColorEquals(kBlack, buffer.getLED(1));
|
||||
assertColorEquals(kBlack, buffer.getLED(2));
|
||||
assertColorEquals(kRed, buffer.getLED(3));
|
||||
assertColorEquals(kRed, buffer.getLED(4));
|
||||
assertColorEquals(kBlue, buffer.getLED(5));
|
||||
assertColorEquals(kBlue, buffer.getLED(6));
|
||||
assertColorEquals(kBlack, buffer.getLED(7));
|
||||
assertColorEquals(BLACK, buffer.getLED(0));
|
||||
assertColorEquals(BLACK, buffer.getLED(1));
|
||||
assertColorEquals(BLACK, buffer.getLED(2));
|
||||
assertColorEquals(RED, buffer.getLED(3));
|
||||
assertColorEquals(RED, buffer.getLED(4));
|
||||
assertColorEquals(BLUE, buffer.getLED(5));
|
||||
assertColorEquals(BLUE, buffer.getLED(6));
|
||||
assertColorEquals(BLACK, buffer.getLED(7));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class Arm implements AutoCloseable {
|
||||
30,
|
||||
Units.radiansToDegrees(m_armSim.getAngle()),
|
||||
6,
|
||||
new Color8Bit(Color.kYellow)));
|
||||
new Color8Bit(Color.YELLOW)));
|
||||
|
||||
/** Subsystem constructor. */
|
||||
public Arm() {
|
||||
@@ -75,7 +75,7 @@ public class Arm implements AutoCloseable {
|
||||
|
||||
// Put Mechanism 2d to SmartDashboard
|
||||
SmartDashboard.putData("Arm Sim", m_mech2d);
|
||||
m_armTower.setColor(new Color8Bit(Color.kBlue));
|
||||
m_armTower.setColor(new Color8Bit(Color.BLUE));
|
||||
|
||||
// Set the Arm position setpoint and P constant to Preferences if the keys don't already exist
|
||||
Preferences.initDouble(Constants.kArmPositionKey, m_armSetpointDegrees);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class Robot extends TimedRobot {
|
||||
m_elevator = root.append(new MechanismLigament2d("elevator", kElevatorMinimumLength, 90));
|
||||
m_wrist =
|
||||
m_elevator.append(
|
||||
new MechanismLigament2d("wrist", 0.5, 90, 6, new Color8Bit(Color.kPurple)));
|
||||
new MechanismLigament2d("wrist", 0.5, 90, 6, new Color8Bit(Color.PURPLE)));
|
||||
|
||||
// post the mechanism to the dashboard
|
||||
SmartDashboard.putData("Mech2d", mech);
|
||||
|
||||
@@ -121,11 +121,10 @@ public class Color {
|
||||
|
||||
// try to parse as a named color by matching against k-prefixed static constants in the Color
|
||||
// class
|
||||
String search = str.startsWith("k") ? str : "k" + str;
|
||||
for (var field : Color.class.getFields()) {
|
||||
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())
|
||||
&& Color.class.isAssignableFrom(field.getType())
|
||||
&& field.getName().equalsIgnoreCase(search)) {
|
||||
&& field.getName().equalsIgnoreCase(str)) {
|
||||
try {
|
||||
return (Color) field.get(null);
|
||||
} catch (IllegalAccessException e) {
|
||||
@@ -380,494 +379,491 @@ public class Color {
|
||||
*/
|
||||
|
||||
/** 0x1560BD. */
|
||||
public static final Color kDenim = new Color(0.0823529412, 0.376470589, 0.7411764706, "kDenim");
|
||||
public static final Color DENIM = new Color(0.0823529412, 0.376470589, 0.7411764706, "DENIM");
|
||||
|
||||
/** 0x0066B3. */
|
||||
public static final Color kFirstBlue = new Color(0.0, 0.4, 0.7019607844, "kFirstBlue");
|
||||
public static final Color FIRST_BLUE = new Color(0.0, 0.4, 0.7019607844, "FIRST_BLUE");
|
||||
|
||||
/** 0xED1C24. */
|
||||
public static final Color kFirstRed =
|
||||
new Color(0.9294117648, 0.1098039216, 0.1411764706, "kFirstRed");
|
||||
public static final Color FIRST_RED =
|
||||
new Color(0.9294117648, 0.1098039216, 0.1411764706, "FIRST_RED");
|
||||
|
||||
/*
|
||||
* Standard Colors
|
||||
*/
|
||||
|
||||
/** 0xF0F8FF. */
|
||||
public static final Color kAliceBlue = new Color(0.9411765f, 0.972549f, 1.0f, "kAliceBlue");
|
||||
public static final Color ALICE_BLUE = new Color(0.9411765f, 0.972549f, 1.0f, "ALICE_BLUE");
|
||||
|
||||
/** 0xFAEBD7. */
|
||||
public static final Color kAntiqueWhite =
|
||||
new Color(0.98039216f, 0.92156863f, 0.84313726f, "kAntiqueWhite");
|
||||
public static final Color ANTIQUE_WHITE =
|
||||
new Color(0.98039216f, 0.92156863f, 0.84313726f, "ANTIQUE_WHITE");
|
||||
|
||||
/** 0x00FFFF. */
|
||||
public static final Color kAqua = new Color(0.0f, 1.0f, 1.0f, "kAqua");
|
||||
public static final Color AQUA = new Color(0.0f, 1.0f, 1.0f, "AQUA");
|
||||
|
||||
/** 0x7FFFD4. */
|
||||
public static final Color kAquamarine = new Color(0.49803922f, 1.0f, 0.83137256f, "kAquamarine");
|
||||
public static final Color AQUAMARINE = new Color(0.49803922f, 1.0f, 0.83137256f, "AQUAMARINE");
|
||||
|
||||
/** 0xF0FFFF. */
|
||||
public static final Color kAzure = new Color(0.9411765f, 1.0f, 1.0f, "kAzure");
|
||||
public static final Color AZURE = new Color(0.9411765f, 1.0f, 1.0f, "AZURE");
|
||||
|
||||
/** 0xF5F5DC. */
|
||||
public static final Color kBeige = new Color(0.9607843f, 0.9607843f, 0.8627451f, "kBeige");
|
||||
public static final Color BEIGE = new Color(0.9607843f, 0.9607843f, 0.8627451f, "BEIGE");
|
||||
|
||||
/** 0xFFE4C4. */
|
||||
public static final Color kBisque = new Color(1.0f, 0.89411765f, 0.76862746f, "kBisque");
|
||||
public static final Color BISQUE = new Color(1.0f, 0.89411765f, 0.76862746f, "BISQUE");
|
||||
|
||||
/** 0x000000. */
|
||||
public static final Color kBlack = new Color(0.0f, 0.0f, 0.0f, "kBlack");
|
||||
public static final Color BLACK = new Color(0.0f, 0.0f, 0.0f, "BLACK");
|
||||
|
||||
/** 0xFFEBCD. */
|
||||
public static final Color kBlanchedAlmond =
|
||||
new Color(1.0f, 0.92156863f, 0.8039216f, "kBlanchedAlmond");
|
||||
public static final Color BLANCHED_ALMOND =
|
||||
new Color(1.0f, 0.92156863f, 0.8039216f, "BLANCHED_ALMOND");
|
||||
|
||||
/** 0x0000FF. */
|
||||
public static final Color kBlue = new Color(0.0f, 0.0f, 1.0f, "kBlue");
|
||||
public static final Color BLUE = new Color(0.0f, 0.0f, 1.0f, "BLUE");
|
||||
|
||||
/** 0x8A2BE2. */
|
||||
public static final Color kBlueViolet =
|
||||
new Color(0.5411765f, 0.16862746f, 0.8862745f, "kBlueViolet");
|
||||
public static final Color BLUE_VIOLET =
|
||||
new Color(0.5411765f, 0.16862746f, 0.8862745f, "BLUE_VIOLET");
|
||||
|
||||
/** 0xA52A2A. */
|
||||
public static final Color kBrown = new Color(0.64705884f, 0.16470589f, 0.16470589f, "kBrown");
|
||||
public static final Color BROWN = new Color(0.64705884f, 0.16470589f, 0.16470589f, "BROWN");
|
||||
|
||||
/** 0xDEB887. */
|
||||
public static final Color kBurlywood =
|
||||
new Color(0.87058824f, 0.72156864f, 0.5294118f, "kBurlywood");
|
||||
public static final Color BURLYWOOD =
|
||||
new Color(0.87058824f, 0.72156864f, 0.5294118f, "BURLYWOOD");
|
||||
|
||||
/** 0x5F9EA0. */
|
||||
public static final Color kCadetBlue =
|
||||
new Color(0.37254903f, 0.61960787f, 0.627451f, "kCadetBlue");
|
||||
public static final Color CADET_BLUE =
|
||||
new Color(0.37254903f, 0.61960787f, 0.627451f, "CADET_BLUE");
|
||||
|
||||
/** 0x7FFF00. */
|
||||
public static final Color kChartreuse = new Color(0.49803922f, 1.0f, 0.0f, "kChartreuse");
|
||||
public static final Color CHARTREUSE = new Color(0.49803922f, 1.0f, 0.0f, "CHARTREUSE");
|
||||
|
||||
/** 0xD2691E. */
|
||||
public static final Color kChocolate =
|
||||
new Color(0.8235294f, 0.4117647f, 0.11764706f, "kChocolate");
|
||||
public static final Color CHOCOLATE = new Color(0.8235294f, 0.4117647f, 0.11764706f, "CHOCOLATE");
|
||||
|
||||
/** 0xFF7F50. */
|
||||
public static final Color kCoral = new Color(1.0f, 0.49803922f, 0.3137255f, "kCoral");
|
||||
public static final Color CORAL = new Color(1.0f, 0.49803922f, 0.3137255f, "CORAL");
|
||||
|
||||
/** 0x6495ED. */
|
||||
public static final Color kCornflowerBlue =
|
||||
new Color(0.39215687f, 0.58431375f, 0.92941177f, "kCornflowerBlue");
|
||||
public static final Color CORNFLOWER_BLUE =
|
||||
new Color(0.39215687f, 0.58431375f, 0.92941177f, "CORNFLOWER_BLUE");
|
||||
|
||||
/** 0xFFF8DC. */
|
||||
public static final Color kCornsilk = new Color(1.0f, 0.972549f, 0.8627451f, "kCornsilk");
|
||||
public static final Color CORNSILK = new Color(1.0f, 0.972549f, 0.8627451f, "CORNSILK");
|
||||
|
||||
/** 0xDC143C. */
|
||||
public static final Color kCrimson = new Color(0.8627451f, 0.078431375f, 0.23529412f, "kCrimson");
|
||||
public static final Color CRIMSON = new Color(0.8627451f, 0.078431375f, 0.23529412f, "CRIMSON");
|
||||
|
||||
/** 0x00FFFF. */
|
||||
public static final Color kCyan = new Color(0.0f, 1.0f, 1.0f, "kCyan");
|
||||
public static final Color CYAN = new Color(0.0f, 1.0f, 1.0f, "CYAN");
|
||||
|
||||
/** 0x00008B. */
|
||||
public static final Color kDarkBlue = new Color(0.0f, 0.0f, 0.54509807f, "kDarkBlue");
|
||||
public static final Color DARK_BLUE = new Color(0.0f, 0.0f, 0.54509807f, "DARK_BLUE");
|
||||
|
||||
/** 0x008B8B. */
|
||||
public static final Color kDarkCyan = new Color(0.0f, 0.54509807f, 0.54509807f, "kDarkCyan");
|
||||
public static final Color DARK_CYAN = new Color(0.0f, 0.54509807f, 0.54509807f, "DARK_CYAN");
|
||||
|
||||
/** 0xB8860B. */
|
||||
public static final Color kDarkGoldenrod =
|
||||
new Color(0.72156864f, 0.5254902f, 0.043137256f, "kDarkGoldenrod");
|
||||
public static final Color DARK_GOLDENROD =
|
||||
new Color(0.72156864f, 0.5254902f, 0.043137256f, "DARK_GOLDENROD");
|
||||
|
||||
/** 0xA9A9A9. */
|
||||
public static final Color kDarkGray = new Color(0.6627451f, 0.6627451f, 0.6627451f, "kDarkGray");
|
||||
public static final Color DARK_GRAY = new Color(0.6627451f, 0.6627451f, 0.6627451f, "DARK_GRAY");
|
||||
|
||||
/** 0x006400. */
|
||||
public static final Color kDarkGreen = new Color(0.0f, 0.39215687f, 0.0f, "kDarkGreen");
|
||||
public static final Color DARK_GREEN = new Color(0.0f, 0.39215687f, 0.0f, "DARK_GREEN");
|
||||
|
||||
/** 0xBDB76B. */
|
||||
public static final Color kDarkKhaki =
|
||||
new Color(0.7411765f, 0.7176471f, 0.41960785f, "kDarkKhaki");
|
||||
public static final Color DARK_KHAKI =
|
||||
new Color(0.7411765f, 0.7176471f, 0.41960785f, "DARK_KHAKI");
|
||||
|
||||
/** 0x8B008B. */
|
||||
public static final Color kDarkMagenta =
|
||||
new Color(0.54509807f, 0.0f, 0.54509807f, "kDarkMagenta");
|
||||
public static final Color DARK_MAGENTA =
|
||||
new Color(0.54509807f, 0.0f, 0.54509807f, "DARK_MAGENTA");
|
||||
|
||||
/** 0x556B2F. */
|
||||
public static final Color kDarkOliveGreen =
|
||||
new Color(0.33333334f, 0.41960785f, 0.18431373f, "kDarkOliveGreen");
|
||||
public static final Color DARK_OLIVE_GREEN =
|
||||
new Color(0.33333334f, 0.41960785f, 0.18431373f, "DARK_OLIVE_GREEN");
|
||||
|
||||
/** 0xFF8C00. */
|
||||
public static final Color kDarkOrange = new Color(1.0f, 0.54901963f, 0.0f, "kDarkOrange");
|
||||
public static final Color DARK_ORANGE = new Color(1.0f, 0.54901963f, 0.0f, "DARK_ORANGE");
|
||||
|
||||
/** 0x9932CC. */
|
||||
public static final Color kDarkOrchid = new Color(0.6f, 0.19607843f, 0.8f, "kDarkOrchid");
|
||||
public static final Color DARK_ORCHID = new Color(0.6f, 0.19607843f, 0.8f, "DARK_ORCHID");
|
||||
|
||||
/** 0x8B0000. */
|
||||
public static final Color kDarkRed = new Color(0.54509807f, 0.0f, 0.0f, "kDarkRed");
|
||||
public static final Color DARK_RED = new Color(0.54509807f, 0.0f, 0.0f, "DARK_RED");
|
||||
|
||||
/** 0xE9967A. */
|
||||
public static final Color kDarkSalmon =
|
||||
new Color(0.9137255f, 0.5882353f, 0.47843137f, "kDarkSalmon");
|
||||
public static final Color DARK_SALMON =
|
||||
new Color(0.9137255f, 0.5882353f, 0.47843137f, "DARK_SALMON");
|
||||
|
||||
/** 0x8FBC8F. */
|
||||
public static final Color kDarkSeaGreen =
|
||||
new Color(0.56078434f, 0.7372549f, 0.56078434f, "kDarkSeaGreen");
|
||||
public static final Color DARK_SEA_GREEN =
|
||||
new Color(0.56078434f, 0.7372549f, 0.56078434f, "DARK_SEA_GREEN");
|
||||
|
||||
/** 0x483D8B. */
|
||||
public static final Color kDarkSlateBlue =
|
||||
new Color(0.28235295f, 0.23921569f, 0.54509807f, "kDarkSlateBlue");
|
||||
public static final Color DARK_SLATE_BLUE =
|
||||
new Color(0.28235295f, 0.23921569f, 0.54509807f, "DARK_SLATE_BLUE");
|
||||
|
||||
/** 0x2F4F4F. */
|
||||
public static final Color kDarkSlateGray =
|
||||
new Color(0.18431373f, 0.30980393f, 0.30980393f, "kDarkSlateGray");
|
||||
public static final Color DARK_SLATE_GRAY =
|
||||
new Color(0.18431373f, 0.30980393f, 0.30980393f, "DARK_SLATE_GRAY");
|
||||
|
||||
/** 0x00CED1. */
|
||||
public static final Color kDarkTurquoise =
|
||||
new Color(0.0f, 0.80784315f, 0.81960785f, "kDarkTurquoise");
|
||||
public static final Color DARK_TURQUOISE =
|
||||
new Color(0.0f, 0.80784315f, 0.81960785f, "DARK_TURQUOISE");
|
||||
|
||||
/** 0x9400D3. */
|
||||
public static final Color kDarkViolet = new Color(0.5803922f, 0.0f, 0.827451f, "kDarkViolet");
|
||||
public static final Color DARK_VIOLET = new Color(0.5803922f, 0.0f, 0.827451f, "DARK_VIOLET");
|
||||
|
||||
/** 0xFF1493. */
|
||||
public static final Color kDeepPink = new Color(1.0f, 0.078431375f, 0.5764706f, "kDeepPink");
|
||||
public static final Color DEEP_PINK = new Color(1.0f, 0.078431375f, 0.5764706f, "DEEP_PINK");
|
||||
|
||||
/** 0x00BFFF. */
|
||||
public static final Color kDeepSkyBlue = new Color(0.0f, 0.7490196f, 1.0f, "kDeepSkyBlue");
|
||||
public static final Color DEEP_SKY_BLUE = new Color(0.0f, 0.7490196f, 1.0f, "DEEP_SKY_BLUE");
|
||||
|
||||
/** 0x696969. */
|
||||
public static final Color kDimGray = new Color(0.4117647f, 0.4117647f, 0.4117647f, "kDimGray");
|
||||
public static final Color DIM_GRAY = new Color(0.4117647f, 0.4117647f, 0.4117647f, "DIM_GRAY");
|
||||
|
||||
/** 0x1E90FF. */
|
||||
public static final Color kDodgerBlue = new Color(0.11764706f, 0.5647059f, 1.0f, "kDodgerBlue");
|
||||
public static final Color DODGER_BLUE = new Color(0.11764706f, 0.5647059f, 1.0f, "DODGER_BLUE");
|
||||
|
||||
/** 0xB22222. */
|
||||
public static final Color kFirebrick =
|
||||
new Color(0.69803923f, 0.13333334f, 0.13333334f, "kFirebrick");
|
||||
public static final Color FIREBRICK =
|
||||
new Color(0.69803923f, 0.13333334f, 0.13333334f, "FIREBRICK");
|
||||
|
||||
/** 0xFFFAF0. */
|
||||
public static final Color kFloralWhite = new Color(1.0f, 0.98039216f, 0.9411765f, "kFloralWhite");
|
||||
public static final Color FLORAL_WHITE = new Color(1.0f, 0.98039216f, 0.9411765f, "FLORAL_WHITE");
|
||||
|
||||
/** 0x228B22. */
|
||||
public static final Color kForestGreen =
|
||||
new Color(0.13333334f, 0.54509807f, 0.13333334f, "kForestGreen");
|
||||
public static final Color FOREST_GREEN =
|
||||
new Color(0.13333334f, 0.54509807f, 0.13333334f, "FOREST_GREEN");
|
||||
|
||||
/** 0xFF00FF. */
|
||||
public static final Color kFuchsia = new Color(1.0f, 0.0f, 1.0f, "kFuchsia");
|
||||
public static final Color FUCHSIA = new Color(1.0f, 0.0f, 1.0f, "FUCHSIA");
|
||||
|
||||
/** 0xDCDCDC. */
|
||||
public static final Color kGainsboro =
|
||||
new Color(0.8627451f, 0.8627451f, 0.8627451f, "kGainsboro");
|
||||
public static final Color GAINSBORO = new Color(0.8627451f, 0.8627451f, 0.8627451f, "GAINSBORO");
|
||||
|
||||
/** 0xF8F8FF. */
|
||||
public static final Color kGhostWhite = new Color(0.972549f, 0.972549f, 1.0f, "kGhostWhite");
|
||||
public static final Color GHOST_WHITE = new Color(0.972549f, 0.972549f, 1.0f, "GHOST_WHITE");
|
||||
|
||||
/** 0xFFD700. */
|
||||
public static final Color kGold = new Color(1.0f, 0.84313726f, 0.0f, "kGold");
|
||||
public static final Color GOLD = new Color(1.0f, 0.84313726f, 0.0f, "GOLD");
|
||||
|
||||
/** 0xDAA520. */
|
||||
public static final Color kGoldenrod =
|
||||
new Color(0.85490197f, 0.64705884f, 0.1254902f, "kGoldenrod");
|
||||
public static final Color GOLDENROD =
|
||||
new Color(0.85490197f, 0.64705884f, 0.1254902f, "GOLDENROD");
|
||||
|
||||
/** 0x808080. */
|
||||
public static final Color kGray = new Color(0.5019608f, 0.5019608f, 0.5019608f, "kGray");
|
||||
public static final Color GRAY = new Color(0.5019608f, 0.5019608f, 0.5019608f, "GRAY");
|
||||
|
||||
/** 0x008000. */
|
||||
public static final Color kGreen = new Color(0.0f, 0.5019608f, 0.0f, "kGreen");
|
||||
public static final Color GREEN = new Color(0.0f, 0.5019608f, 0.0f, "GREEN");
|
||||
|
||||
/** 0xADFF2F. */
|
||||
public static final Color kGreenYellow = new Color(0.6784314f, 1.0f, 0.18431373f, "kGreenYellow");
|
||||
public static final Color GREEN_YELLOW = new Color(0.6784314f, 1.0f, 0.18431373f, "GREEN_YELLOW");
|
||||
|
||||
/** 0xF0FFF0. */
|
||||
public static final Color kHoneydew = new Color(0.9411765f, 1.0f, 0.9411765f, "kHoneydew");
|
||||
public static final Color HONEYDEW = new Color(0.9411765f, 1.0f, 0.9411765f, "HONEYDEW");
|
||||
|
||||
/** 0xFF69B4. */
|
||||
public static final Color kHotPink = new Color(1.0f, 0.4117647f, 0.7058824f, "kHotPink");
|
||||
public static final Color HOT_PINK = new Color(1.0f, 0.4117647f, 0.7058824f, "HOT_PINK");
|
||||
|
||||
/** 0xCD5C5C. */
|
||||
public static final Color kIndianRed =
|
||||
new Color(0.8039216f, 0.36078432f, 0.36078432f, "kIndianRed");
|
||||
public static final Color INDIAN_RED =
|
||||
new Color(0.8039216f, 0.36078432f, 0.36078432f, "INDIAN_RED");
|
||||
|
||||
/** 0x4B0082. */
|
||||
public static final Color kIndigo = new Color(0.29411766f, 0.0f, 0.50980395f, "kIndigo");
|
||||
public static final Color INDIGO = new Color(0.29411766f, 0.0f, 0.50980395f, "INDIGO");
|
||||
|
||||
/** 0xFFFFF0. */
|
||||
public static final Color kIvory = new Color(1.0f, 1.0f, 0.9411765f, "kIvory");
|
||||
public static final Color IVORY = new Color(1.0f, 1.0f, 0.9411765f, "IVORY");
|
||||
|
||||
/** 0xF0E68C. */
|
||||
public static final Color kKhaki = new Color(0.9411765f, 0.9019608f, 0.54901963f, "kKhaki");
|
||||
public static final Color KHAKI = new Color(0.9411765f, 0.9019608f, 0.54901963f, "KHAKI");
|
||||
|
||||
/** 0xE6E6FA. */
|
||||
public static final Color kLavender = new Color(0.9019608f, 0.9019608f, 0.98039216f, "kLavender");
|
||||
public static final Color LAVENDER = new Color(0.9019608f, 0.9019608f, 0.98039216f, "LAVENDER");
|
||||
|
||||
/** 0xFFF0F5. */
|
||||
public static final Color kLavenderBlush =
|
||||
new Color(1.0f, 0.9411765f, 0.9607843f, "kLavenderBlush");
|
||||
public static final Color LAVENDER_BLUSH =
|
||||
new Color(1.0f, 0.9411765f, 0.9607843f, "LAVENDER_BLUSH");
|
||||
|
||||
/** 0x7CFC00. */
|
||||
public static final Color kLawnGreen = new Color(0.4862745f, 0.9882353f, 0.0f, "kLawnGreen");
|
||||
public static final Color LAWN_GREEN = new Color(0.4862745f, 0.9882353f, 0.0f, "LAWN_GREEN");
|
||||
|
||||
/** 0xFFFACD. */
|
||||
public static final Color kLemonChiffon =
|
||||
new Color(1.0f, 0.98039216f, 0.8039216f, "kLemonChiffon");
|
||||
public static final Color LEMON_CHIFFON =
|
||||
new Color(1.0f, 0.98039216f, 0.8039216f, "LEMON_CHIFFON");
|
||||
|
||||
/** 0xADD8E6. */
|
||||
public static final Color kLightBlue =
|
||||
new Color(0.6784314f, 0.84705883f, 0.9019608f, "kLightBlue");
|
||||
public static final Color LIGHT_BLUE =
|
||||
new Color(0.6784314f, 0.84705883f, 0.9019608f, "LIGHT_BLUE");
|
||||
|
||||
/** 0xF08080. */
|
||||
public static final Color kLightCoral =
|
||||
new Color(0.9411765f, 0.5019608f, 0.5019608f, "kLightCoral");
|
||||
public static final Color LIGHT_CORAL =
|
||||
new Color(0.9411765f, 0.5019608f, 0.5019608f, "LIGHT_CORAL");
|
||||
|
||||
/** 0xE0FFFF. */
|
||||
public static final Color kLightCyan = new Color(0.8784314f, 1.0f, 1.0f, "kLightCyan");
|
||||
public static final Color LIGHT_CYAN = new Color(0.8784314f, 1.0f, 1.0f, "LIGHT_CYAN");
|
||||
|
||||
/** 0xFAFAD2. */
|
||||
public static final Color kLightGoldenrodYellow =
|
||||
new Color(0.98039216f, 0.98039216f, 0.8235294f, "kLightGoldenrodYellow");
|
||||
public static final Color LIGHT_GOLDENROD_YELLOW =
|
||||
new Color(0.98039216f, 0.98039216f, 0.8235294f, "LIGHT_GOLDENROD_YELLOW");
|
||||
|
||||
/** 0xD3D3D3. */
|
||||
public static final Color kLightGray = new Color(0.827451f, 0.827451f, 0.827451f, "kLightGray");
|
||||
public static final Color LIGHT_GRAY = new Color(0.827451f, 0.827451f, 0.827451f, "LIGHT_GRAY");
|
||||
|
||||
/** 0x90EE90. */
|
||||
public static final Color kLightGreen =
|
||||
new Color(0.5647059f, 0.93333334f, 0.5647059f, "kLightGreen");
|
||||
public static final Color LIGHT_GREEN =
|
||||
new Color(0.5647059f, 0.93333334f, 0.5647059f, "LIGHT_GREEN");
|
||||
|
||||
/** 0xFFB6C1. */
|
||||
public static final Color kLightPink = new Color(1.0f, 0.7137255f, 0.75686276f, "kLightPink");
|
||||
public static final Color LIGHT_PINK = new Color(1.0f, 0.7137255f, 0.75686276f, "LIGHT_PINK");
|
||||
|
||||
/** 0xFFA07A. */
|
||||
public static final Color kLightSalmon = new Color(1.0f, 0.627451f, 0.47843137f, "kLightSalmon");
|
||||
public static final Color LIGHT_SALMON = new Color(1.0f, 0.627451f, 0.47843137f, "LIGHT_SALMON");
|
||||
|
||||
/** 0x20B2AA. */
|
||||
public static final Color kLightSeaGreen =
|
||||
new Color(0.1254902f, 0.69803923f, 0.6666667f, "kLightSeaGreen");
|
||||
public static final Color LIGHT_SEA_GREEN =
|
||||
new Color(0.1254902f, 0.69803923f, 0.6666667f, "LIGHT_SEA_GREEN");
|
||||
|
||||
/** 0x87CEFA. */
|
||||
public static final Color kLightSkyBlue =
|
||||
new Color(0.5294118f, 0.80784315f, 0.98039216f, "kLightSkyBlue");
|
||||
public static final Color LIGHT_SKY_BLUE =
|
||||
new Color(0.5294118f, 0.80784315f, 0.98039216f, "LIGHT_SKY_BLUE");
|
||||
|
||||
/** 0x778899. */
|
||||
public static final Color kLightSlateGray =
|
||||
new Color(0.46666667f, 0.53333336f, 0.6f, "kLightSlateGray");
|
||||
public static final Color LIGHT_SLATE_GRAY =
|
||||
new Color(0.46666667f, 0.53333336f, 0.6f, "LIGHT_SLATE_GRAY");
|
||||
|
||||
/** 0xB0C4DE. */
|
||||
public static final Color kLightSteelBlue =
|
||||
new Color(0.6901961f, 0.76862746f, 0.87058824f, "kLightSteelBlue");
|
||||
public static final Color LIGHT_STEEL_BLUE =
|
||||
new Color(0.6901961f, 0.76862746f, 0.87058824f, "LIGHT_STEEL_BLUE");
|
||||
|
||||
/** 0xFFFFE0. */
|
||||
public static final Color kLightYellow = new Color(1.0f, 1.0f, 0.8784314f, "kLightYellow");
|
||||
public static final Color LIGHT_YELLOW = new Color(1.0f, 1.0f, 0.8784314f, "LIGHT_YELLOW");
|
||||
|
||||
/** 0x00FF00. */
|
||||
public static final Color kLime = new Color(0.0f, 1.0f, 0.0f, "kLime");
|
||||
public static final Color LIME = new Color(0.0f, 1.0f, 0.0f, "LIME");
|
||||
|
||||
/** 0x32CD32. */
|
||||
public static final Color kLimeGreen =
|
||||
new Color(0.19607843f, 0.8039216f, 0.19607843f, "kLimeGreen");
|
||||
public static final Color LIME_GREEN =
|
||||
new Color(0.19607843f, 0.8039216f, 0.19607843f, "LIME_GREEN");
|
||||
|
||||
/** 0xFAF0E6. */
|
||||
public static final Color kLinen = new Color(0.98039216f, 0.9411765f, 0.9019608f, "kLinen");
|
||||
public static final Color LINEN = new Color(0.98039216f, 0.9411765f, 0.9019608f, "LINEN");
|
||||
|
||||
/** 0xFF00FF. */
|
||||
public static final Color kMagenta = new Color(1.0f, 0.0f, 1.0f, "kMagenta");
|
||||
public static final Color MAGENTA = new Color(1.0f, 0.0f, 1.0f, "MAGENTA");
|
||||
|
||||
/** 0x800000. */
|
||||
public static final Color kMaroon = new Color(0.5019608f, 0.0f, 0.0f, "kMaroon");
|
||||
public static final Color MAROON = new Color(0.5019608f, 0.0f, 0.0f, "MAROON");
|
||||
|
||||
/** 0x66CDAA. */
|
||||
public static final Color kMediumAquamarine =
|
||||
new Color(0.4f, 0.8039216f, 0.6666667f, "kMediumAquamarine");
|
||||
public static final Color MEDIUM_AQUAMARINE =
|
||||
new Color(0.4f, 0.8039216f, 0.6666667f, "MEDIUM_AQUAMARINE");
|
||||
|
||||
/** 0x0000CD. */
|
||||
public static final Color kMediumBlue = new Color(0.0f, 0.0f, 0.8039216f, "kMediumBlue");
|
||||
public static final Color MEDIUM_BLUE = new Color(0.0f, 0.0f, 0.8039216f, "MEDIUM_BLUE");
|
||||
|
||||
/** 0xBA55D3. */
|
||||
public static final Color kMediumOrchid =
|
||||
new Color(0.7294118f, 0.33333334f, 0.827451f, "kMediumOrchid");
|
||||
public static final Color MEDIUM_ORCHID =
|
||||
new Color(0.7294118f, 0.33333334f, 0.827451f, "MEDIUM_ORCHID");
|
||||
|
||||
/** 0x9370DB. */
|
||||
public static final Color kMediumPurple =
|
||||
new Color(0.5764706f, 0.4392157f, 0.85882354f, "kMediumPurple");
|
||||
public static final Color MEDIUM_PURPLE =
|
||||
new Color(0.5764706f, 0.4392157f, 0.85882354f, "MEDIUM_PURPLE");
|
||||
|
||||
/** 0x3CB371. */
|
||||
public static final Color kMediumSeaGreen =
|
||||
new Color(0.23529412f, 0.7019608f, 0.44313726f, "kMediumSeaGreen");
|
||||
public static final Color MEDIUM_SEA_GREEN =
|
||||
new Color(0.23529412f, 0.7019608f, 0.44313726f, "MEDIUM_SEA_GREEN");
|
||||
|
||||
/** 0x7B68EE. */
|
||||
public static final Color kMediumSlateBlue =
|
||||
new Color(0.48235294f, 0.40784314f, 0.93333334f, "kMediumSlateBlue");
|
||||
public static final Color MEDIUM_SLATE_BLUE =
|
||||
new Color(0.48235294f, 0.40784314f, 0.93333334f, "MEDIUM_SLATE_BLUE");
|
||||
|
||||
/** 0x00FA9A. */
|
||||
public static final Color kMediumSpringGreen =
|
||||
new Color(0.0f, 0.98039216f, 0.6039216f, "kMediumSpringGreen");
|
||||
public static final Color MEDIUM_SPRING_GREEN =
|
||||
new Color(0.0f, 0.98039216f, 0.6039216f, "MEDIUM_SPRING_GREEN");
|
||||
|
||||
/** 0x48D1CC. */
|
||||
public static final Color kMediumTurquoise =
|
||||
new Color(0.28235295f, 0.81960785f, 0.8f, "kMediumTurquoise");
|
||||
public static final Color MEDIUM_TURQUOISE =
|
||||
new Color(0.28235295f, 0.81960785f, 0.8f, "MEDIUM_TURQUOISE");
|
||||
|
||||
/** 0xC71585. */
|
||||
public static final Color kMediumVioletRed =
|
||||
new Color(0.78039217f, 0.08235294f, 0.52156866f, "kMediumVioletRed");
|
||||
public static final Color MEDIUM_VIOLET_RED =
|
||||
new Color(0.78039217f, 0.08235294f, 0.52156866f, "MEDIUM_VIOLET_RED");
|
||||
|
||||
/** 0x191970. */
|
||||
public static final Color kMidnightBlue =
|
||||
new Color(0.09803922f, 0.09803922f, 0.4392157f, "kMidnightBlue");
|
||||
public static final Color MIDNIGHT_BLUE =
|
||||
new Color(0.09803922f, 0.09803922f, 0.4392157f, "MIDNIGHT_BLUE");
|
||||
|
||||
/** 0xF5FFFA. */
|
||||
public static final Color kMintcream = new Color(0.9607843f, 1.0f, 0.98039216f, "kMintcream");
|
||||
public static final Color MINTCREAM = new Color(0.9607843f, 1.0f, 0.98039216f, "MINTCREAM");
|
||||
|
||||
/** 0xFFE4E1. */
|
||||
public static final Color kMistyRose = new Color(1.0f, 0.89411765f, 0.88235295f, "kMistyRose");
|
||||
public static final Color MISTY_ROSE = new Color(1.0f, 0.89411765f, 0.88235295f, "MISTY_ROSE");
|
||||
|
||||
/** 0xFFE4B5. */
|
||||
public static final Color kMoccasin = new Color(1.0f, 0.89411765f, 0.70980394f, "kMoccasin");
|
||||
public static final Color MOCCASIN = new Color(1.0f, 0.89411765f, 0.70980394f, "MOCCASIN");
|
||||
|
||||
/** 0xFFDEAD. */
|
||||
public static final Color kNavajoWhite = new Color(1.0f, 0.87058824f, 0.6784314f, "kNavajoWhite");
|
||||
public static final Color NAVAJO_WHITE = new Color(1.0f, 0.87058824f, 0.6784314f, "NAVAJO_WHITE");
|
||||
|
||||
/** 0x000080. */
|
||||
public static final Color kNavy = new Color(0.0f, 0.0f, 0.5019608f, "kNavy");
|
||||
public static final Color NAVY = new Color(0.0f, 0.0f, 0.5019608f, "NAVY");
|
||||
|
||||
/** 0xFDF5E6. */
|
||||
public static final Color kOldLace = new Color(0.99215686f, 0.9607843f, 0.9019608f, "kOldLace");
|
||||
public static final Color OLD_LACE = new Color(0.99215686f, 0.9607843f, 0.9019608f, "OLD_LACE");
|
||||
|
||||
/** 0x808000. */
|
||||
public static final Color kOlive = new Color(0.5019608f, 0.5019608f, 0.0f, "kOlive");
|
||||
public static final Color OLIVE = new Color(0.5019608f, 0.5019608f, 0.0f, "OLIVE");
|
||||
|
||||
/** 0x6B8E23. */
|
||||
public static final Color kOliveDrab =
|
||||
new Color(0.41960785f, 0.5568628f, 0.13725491f, "kOliveDrab");
|
||||
public static final Color OLIVE_DRAB =
|
||||
new Color(0.41960785f, 0.5568628f, 0.13725491f, "OLIVE_DRAB");
|
||||
|
||||
/** 0xFFA500. */
|
||||
public static final Color kOrange = new Color(1.0f, 0.64705884f, 0.0f, "kOrange");
|
||||
public static final Color ORANGE = new Color(1.0f, 0.64705884f, 0.0f, "ORANGE");
|
||||
|
||||
/** 0xFF4500. */
|
||||
public static final Color kOrangeRed = new Color(1.0f, 0.27058825f, 0.0f, "kOrangeRed");
|
||||
public static final Color ORANGE_RED = new Color(1.0f, 0.27058825f, 0.0f, "ORANGE_RED");
|
||||
|
||||
/** 0xDA70D6. */
|
||||
public static final Color kOrchid = new Color(0.85490197f, 0.4392157f, 0.8392157f, "kOrchid");
|
||||
public static final Color ORCHID = new Color(0.85490197f, 0.4392157f, 0.8392157f, "ORCHID");
|
||||
|
||||
/** 0xEEE8AA. */
|
||||
public static final Color kPaleGoldenrod =
|
||||
new Color(0.93333334f, 0.9098039f, 0.6666667f, "kPaleGoldenrod");
|
||||
public static final Color PALE_GOLDENROD =
|
||||
new Color(0.93333334f, 0.9098039f, 0.6666667f, "PALE_GOLDENROD");
|
||||
|
||||
/** 0x98FB98. */
|
||||
public static final Color kPaleGreen =
|
||||
new Color(0.59607846f, 0.9843137f, 0.59607846f, "kPaleGreen");
|
||||
public static final Color PALE_GREEN =
|
||||
new Color(0.59607846f, 0.9843137f, 0.59607846f, "PALE_GREEN");
|
||||
|
||||
/** 0xAFEEEE. */
|
||||
public static final Color kPaleTurquoise =
|
||||
new Color(0.6862745f, 0.93333334f, 0.93333334f, "kPaleTurquoise");
|
||||
public static final Color PALE_TURQUOISE =
|
||||
new Color(0.6862745f, 0.93333334f, 0.93333334f, "PALE_TURQUOISE");
|
||||
|
||||
/** 0xDB7093. */
|
||||
public static final Color kPaleVioletRed =
|
||||
new Color(0.85882354f, 0.4392157f, 0.5764706f, "kPaleVioletRed");
|
||||
public static final Color PALE_VIOLET_RED =
|
||||
new Color(0.85882354f, 0.4392157f, 0.5764706f, "PALE_VIOLET_RED");
|
||||
|
||||
/** 0xFFEFD5. */
|
||||
public static final Color kPapayaWhip = new Color(1.0f, 0.9372549f, 0.8352941f, "kPapayaWhip");
|
||||
public static final Color PAPAYA_WHIP = new Color(1.0f, 0.9372549f, 0.8352941f, "PAPAYA_WHIP");
|
||||
|
||||
/** 0xFFDAB9. */
|
||||
public static final Color kPeachPuff = new Color(1.0f, 0.85490197f, 0.7254902f, "kPeachPuff");
|
||||
public static final Color PEACH_PUFF = new Color(1.0f, 0.85490197f, 0.7254902f, "PEACH_PUFF");
|
||||
|
||||
/** 0xCD853F. */
|
||||
public static final Color kPeru = new Color(0.8039216f, 0.52156866f, 0.24705882f, "kPeru");
|
||||
public static final Color PERU = new Color(0.8039216f, 0.52156866f, 0.24705882f, "PERU");
|
||||
|
||||
/** 0xFFC0CB. */
|
||||
public static final Color kPink = new Color(1.0f, 0.7529412f, 0.79607844f, "kPink");
|
||||
public static final Color PINK = new Color(1.0f, 0.7529412f, 0.79607844f, "PINK");
|
||||
|
||||
/** 0xDDA0DD. */
|
||||
public static final Color kPlum = new Color(0.8666667f, 0.627451f, 0.8666667f, "kPlum");
|
||||
public static final Color PLUM = new Color(0.8666667f, 0.627451f, 0.8666667f, "PLUM");
|
||||
|
||||
/** 0xB0E0E6. */
|
||||
public static final Color kPowderBlue =
|
||||
new Color(0.6901961f, 0.8784314f, 0.9019608f, "kPowderBlue");
|
||||
public static final Color POWDER_BLUE =
|
||||
new Color(0.6901961f, 0.8784314f, 0.9019608f, "POWDER_BLUE");
|
||||
|
||||
/** 0x800080. */
|
||||
public static final Color kPurple = new Color(0.5019608f, 0.0f, 0.5019608f, "kPurple");
|
||||
public static final Color PURPLE = new Color(0.5019608f, 0.0f, 0.5019608f, "PURPLE");
|
||||
|
||||
/** 0xFF0000. */
|
||||
public static final Color kRed = new Color(1.0f, 0.0f, 0.0f, "kRed");
|
||||
public static final Color RED = new Color(1.0f, 0.0f, 0.0f, "RED");
|
||||
|
||||
/** 0xBC8F8F. */
|
||||
public static final Color kRosyBrown =
|
||||
new Color(0.7372549f, 0.56078434f, 0.56078434f, "kRosyBrown");
|
||||
public static final Color ROSY_BROWN =
|
||||
new Color(0.7372549f, 0.56078434f, 0.56078434f, "ROSY_BROWN");
|
||||
|
||||
/** 0x4169E1. */
|
||||
public static final Color kRoyalBlue =
|
||||
new Color(0.25490198f, 0.4117647f, 0.88235295f, "kRoyalBlue");
|
||||
public static final Color ROYAL_BLUE =
|
||||
new Color(0.25490198f, 0.4117647f, 0.88235295f, "ROYAL_BLUE");
|
||||
|
||||
/** 0x8B4513. */
|
||||
public static final Color kSaddleBrown =
|
||||
new Color(0.54509807f, 0.27058825f, 0.07450981f, "kSaddleBrown");
|
||||
public static final Color SADDLE_BROWN =
|
||||
new Color(0.54509807f, 0.27058825f, 0.07450981f, "SADDLE_BROWN");
|
||||
|
||||
/** 0xFA8072. */
|
||||
public static final Color kSalmon = new Color(0.98039216f, 0.5019608f, 0.44705883f, "kSalmon");
|
||||
public static final Color SALMON = new Color(0.98039216f, 0.5019608f, 0.44705883f, "SALMON");
|
||||
|
||||
/** 0xF4A460. */
|
||||
public static final Color kSandyBrown =
|
||||
new Color(0.95686275f, 0.6431373f, 0.3764706f, "kSandyBrown");
|
||||
public static final Color SANDY_BROWN =
|
||||
new Color(0.95686275f, 0.6431373f, 0.3764706f, "SANDY_BROWN");
|
||||
|
||||
/** 0x2E8B57. */
|
||||
public static final Color kSeaGreen =
|
||||
new Color(0.18039216f, 0.54509807f, 0.34117648f, "kSeaGreen");
|
||||
public static final Color SEA_GREEN =
|
||||
new Color(0.18039216f, 0.54509807f, 0.34117648f, "SEA_GREEN");
|
||||
|
||||
/** 0xFFF5EE. */
|
||||
public static final Color kSeashell = new Color(1.0f, 0.9607843f, 0.93333334f, "kSeashell");
|
||||
public static final Color SEASHELL = new Color(1.0f, 0.9607843f, 0.93333334f, "SEASHELL");
|
||||
|
||||
/** 0xA0522D. */
|
||||
public static final Color kSienna = new Color(0.627451f, 0.32156864f, 0.1764706f, "kSienna");
|
||||
public static final Color SIENNA = new Color(0.627451f, 0.32156864f, 0.1764706f, "SIENNA");
|
||||
|
||||
/** 0xC0C0C0. */
|
||||
public static final Color kSilver = new Color(0.7529412f, 0.7529412f, 0.7529412f, "kSilver");
|
||||
public static final Color SILVER = new Color(0.7529412f, 0.7529412f, 0.7529412f, "SILVER");
|
||||
|
||||
/** 0x87CEEB. */
|
||||
public static final Color kSkyBlue = new Color(0.5294118f, 0.80784315f, 0.92156863f, "kSkyBlue");
|
||||
public static final Color SKY_BLUE = new Color(0.5294118f, 0.80784315f, 0.92156863f, "SKY_BLUE");
|
||||
|
||||
/** 0x6A5ACD. */
|
||||
public static final Color kSlateBlue =
|
||||
new Color(0.41568628f, 0.3529412f, 0.8039216f, "kSlateBlue");
|
||||
public static final Color SLATE_BLUE =
|
||||
new Color(0.41568628f, 0.3529412f, 0.8039216f, "SLATE_BLUE");
|
||||
|
||||
/** 0x708090. */
|
||||
public static final Color kSlateGray =
|
||||
new Color(0.4392157f, 0.5019608f, 0.5647059f, "kSlateGray");
|
||||
public static final Color SLATE_GRAY =
|
||||
new Color(0.4392157f, 0.5019608f, 0.5647059f, "SLATE_GRAY");
|
||||
|
||||
/** 0xFFFAFA. */
|
||||
public static final Color kSnow = new Color(1.0f, 0.98039216f, 0.98039216f, "kSnow");
|
||||
public static final Color SNOW = new Color(1.0f, 0.98039216f, 0.98039216f, "SNOW");
|
||||
|
||||
/** 0x00FF7F. */
|
||||
public static final Color kSpringGreen = new Color(0.0f, 1.0f, 0.49803922f, "kSpringGreen");
|
||||
public static final Color SPRING_GREEN = new Color(0.0f, 1.0f, 0.49803922f, "SPRING_GREEN");
|
||||
|
||||
/** 0x4682B4. */
|
||||
public static final Color kSteelBlue =
|
||||
new Color(0.27450982f, 0.50980395f, 0.7058824f, "kSteelBlue");
|
||||
public static final Color STEEL_BLUE =
|
||||
new Color(0.27450982f, 0.50980395f, 0.7058824f, "STEEL_BLUE");
|
||||
|
||||
/** 0xD2B48C. */
|
||||
public static final Color kTan = new Color(0.8235294f, 0.7058824f, 0.54901963f, "kTan");
|
||||
public static final Color TAN = new Color(0.8235294f, 0.7058824f, 0.54901963f, "TAN");
|
||||
|
||||
/** 0x008080. */
|
||||
public static final Color kTeal = new Color(0.0f, 0.5019608f, 0.5019608f, "kTeal");
|
||||
public static final Color TEAL = new Color(0.0f, 0.5019608f, 0.5019608f, "TEAL");
|
||||
|
||||
/** 0xD8BFD8. */
|
||||
public static final Color kThistle = new Color(0.84705883f, 0.7490196f, 0.84705883f, "kThistle");
|
||||
public static final Color THISTLE = new Color(0.84705883f, 0.7490196f, 0.84705883f, "THISTLE");
|
||||
|
||||
/** 0xFF6347. */
|
||||
public static final Color kTomato = new Color(1.0f, 0.3882353f, 0.2784314f, "kTomato");
|
||||
public static final Color TOMATO = new Color(1.0f, 0.3882353f, 0.2784314f, "TOMATO");
|
||||
|
||||
/** 0x40E0D0. */
|
||||
public static final Color kTurquoise =
|
||||
new Color(0.2509804f, 0.8784314f, 0.8156863f, "kTurquoise");
|
||||
public static final Color TURQUOISE = new Color(0.2509804f, 0.8784314f, 0.8156863f, "TURQUOISE");
|
||||
|
||||
/** 0xEE82EE. */
|
||||
public static final Color kViolet = new Color(0.93333334f, 0.50980395f, 0.93333334f, "kViolet");
|
||||
public static final Color VIOLET = new Color(0.93333334f, 0.50980395f, 0.93333334f, "VIOLET");
|
||||
|
||||
/** 0xF5DEB3. */
|
||||
public static final Color kWheat = new Color(0.9607843f, 0.87058824f, 0.7019608f, "kWheat");
|
||||
public static final Color WHEAT = new Color(0.9607843f, 0.87058824f, 0.7019608f, "WHEAT");
|
||||
|
||||
/** 0xFFFFFF. */
|
||||
public static final Color kWhite = new Color(1.0f, 1.0f, 1.0f, "kWhite");
|
||||
public static final Color WHITE = new Color(1.0f, 1.0f, 1.0f, "WHITE");
|
||||
|
||||
/** 0xF5F5F5. */
|
||||
public static final Color kWhiteSmoke =
|
||||
new Color(0.9607843f, 0.9607843f, 0.9607843f, "kWhiteSmoke");
|
||||
public static final Color WHITE_SMOKE =
|
||||
new Color(0.9607843f, 0.9607843f, 0.9607843f, "WHITE_SMOKE");
|
||||
|
||||
/** 0xFFFF00. */
|
||||
public static final Color kYellow = new Color(1.0f, 1.0f, 0.0f, "kYellow");
|
||||
public static final Color YELLOW = new Color(1.0f, 1.0f, 0.0f, "YELLOW");
|
||||
|
||||
/** 0x9ACD32. */
|
||||
public static final Color kYellowGreen =
|
||||
new Color(0.6039216f, 0.8039216f, 0.19607843f, "kYellowGreen");
|
||||
public static final Color YELLOW_GREEN =
|
||||
new Color(0.6039216f, 0.8039216f, 0.19607843f, "YELLOW_GREEN");
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,149 +6,149 @@ classes:
|
||||
force_type_casters:
|
||||
- wpi::util::ct_string
|
||||
attributes:
|
||||
kDenim:
|
||||
kFirstBlue:
|
||||
kFirstRed:
|
||||
kAliceBlue:
|
||||
kAntiqueWhite:
|
||||
kAqua:
|
||||
kAquamarine:
|
||||
kAzure:
|
||||
kBeige:
|
||||
kBisque:
|
||||
kBlack:
|
||||
kBlanchedAlmond:
|
||||
kBlue:
|
||||
kBlueViolet:
|
||||
kBrown:
|
||||
kBurlywood:
|
||||
kCadetBlue:
|
||||
kChartreuse:
|
||||
kChocolate:
|
||||
kCoral:
|
||||
kCornflowerBlue:
|
||||
kCornsilk:
|
||||
kCrimson:
|
||||
kCyan:
|
||||
kDarkBlue:
|
||||
kDarkCyan:
|
||||
kDarkGoldenrod:
|
||||
kDarkGray:
|
||||
kDarkGreen:
|
||||
kDarkKhaki:
|
||||
kDarkMagenta:
|
||||
kDarkOliveGreen:
|
||||
kDarkOrange:
|
||||
kDarkOrchid:
|
||||
kDarkRed:
|
||||
kDarkSalmon:
|
||||
kDarkSeaGreen:
|
||||
kDarkSlateBlue:
|
||||
kDarkSlateGray:
|
||||
kDarkTurquoise:
|
||||
kDarkViolet:
|
||||
kDeepPink:
|
||||
kDeepSkyBlue:
|
||||
kDimGray:
|
||||
kDodgerBlue:
|
||||
kFirebrick:
|
||||
kFloralWhite:
|
||||
kForestGreen:
|
||||
kFuchsia:
|
||||
kGainsboro:
|
||||
kGhostWhite:
|
||||
kGold:
|
||||
kGoldenrod:
|
||||
kGray:
|
||||
kGreen:
|
||||
kGreenYellow:
|
||||
kHoneydew:
|
||||
kHotPink:
|
||||
kIndianRed:
|
||||
kIndigo:
|
||||
kIvory:
|
||||
kKhaki:
|
||||
kLavender:
|
||||
kLavenderBlush:
|
||||
kLawnGreen:
|
||||
kLemonChiffon:
|
||||
kLightBlue:
|
||||
kLightCoral:
|
||||
kLightCyan:
|
||||
kLightGoldenrodYellow:
|
||||
kLightGray:
|
||||
kLightGreen:
|
||||
kLightPink:
|
||||
kLightSalmon:
|
||||
kLightSeaGreen:
|
||||
kLightSkyBlue:
|
||||
kLightSlateGray:
|
||||
kLightSteelBlue:
|
||||
kLightYellow:
|
||||
kLime:
|
||||
kLimeGreen:
|
||||
kLinen:
|
||||
kMagenta:
|
||||
kMaroon:
|
||||
kMediumAquamarine:
|
||||
kMediumBlue:
|
||||
kMediumOrchid:
|
||||
kMediumPurple:
|
||||
kMediumSeaGreen:
|
||||
kMediumSlateBlue:
|
||||
kMediumSpringGreen:
|
||||
kMediumTurquoise:
|
||||
kMediumVioletRed:
|
||||
kMidnightBlue:
|
||||
kMintcream:
|
||||
kMistyRose:
|
||||
kMoccasin:
|
||||
kNavajoWhite:
|
||||
kNavy:
|
||||
kOldLace:
|
||||
kOlive:
|
||||
kOliveDrab:
|
||||
kOrange:
|
||||
kOrangeRed:
|
||||
kOrchid:
|
||||
kPaleGoldenrod:
|
||||
kPaleGreen:
|
||||
kPaleTurquoise:
|
||||
kPaleVioletRed:
|
||||
kPapayaWhip:
|
||||
kPeachPuff:
|
||||
kPeru:
|
||||
kPink:
|
||||
kPlum:
|
||||
kPowderBlue:
|
||||
kPurple:
|
||||
kRed:
|
||||
kRosyBrown:
|
||||
kRoyalBlue:
|
||||
kSaddleBrown:
|
||||
kSalmon:
|
||||
kSandyBrown:
|
||||
kSeaGreen:
|
||||
kSeashell:
|
||||
kSienna:
|
||||
kSilver:
|
||||
kSkyBlue:
|
||||
kSlateBlue:
|
||||
kSlateGray:
|
||||
kSnow:
|
||||
kSpringGreen:
|
||||
kSteelBlue:
|
||||
kTan:
|
||||
kTeal:
|
||||
kThistle:
|
||||
kTomato:
|
||||
kTurquoise:
|
||||
kViolet:
|
||||
kWheat:
|
||||
kWhite:
|
||||
kWhiteSmoke:
|
||||
kYellow:
|
||||
kYellowGreen:
|
||||
DENIM:
|
||||
FIRST_BLUE:
|
||||
FIRST_RED:
|
||||
ALICE_BLUE:
|
||||
ANTIQUE_WHITE:
|
||||
AQUA:
|
||||
AQUAMARINE:
|
||||
AZURE:
|
||||
BEIGE:
|
||||
BISQUE:
|
||||
BLACK:
|
||||
BLANCHED_ALMOND:
|
||||
BLUE:
|
||||
BLUE_VIOLET:
|
||||
BROWN:
|
||||
BURLYWOOD:
|
||||
CADET_BLUE:
|
||||
CHARTREUSE:
|
||||
CHOCOLATE:
|
||||
CORAL:
|
||||
CORNFLOWER_BLUE:
|
||||
CORNSILK:
|
||||
CRIMSON:
|
||||
CYAN:
|
||||
DARK_BLUE:
|
||||
DARK_CYAN:
|
||||
DARK_GOLDENROD:
|
||||
DARK_GRAY:
|
||||
DARK_GREEN:
|
||||
DARK_KHAKI:
|
||||
DARK_MAGENTA:
|
||||
DARK_OLIVE_GREEN:
|
||||
DARK_ORANGE:
|
||||
DARK_ORCHID:
|
||||
DARK_RED:
|
||||
DARK_SALMON:
|
||||
DARK_SEA_GREEN:
|
||||
DARK_SLATE_BLUE:
|
||||
DARK_SLATE_GRAY:
|
||||
DARK_TURQUOISE:
|
||||
DARK_VIOLET:
|
||||
DEEP_PINK:
|
||||
DEEP_SKY_BLUE:
|
||||
DIM_GRAY:
|
||||
DODGER_BLUE:
|
||||
FIREBRICK:
|
||||
FLORAL_WHITE:
|
||||
FOREST_GREEN:
|
||||
FUCHSIA:
|
||||
GAINSBORO:
|
||||
GHOST_WHITE:
|
||||
GOLD:
|
||||
GOLDENROD:
|
||||
GRAY:
|
||||
GREEN:
|
||||
GREEN_YELLOW:
|
||||
HONEYDEW:
|
||||
HOT_PINK:
|
||||
INDIAN_RED:
|
||||
INDIGO:
|
||||
IVORY:
|
||||
KHAKI:
|
||||
LAVENDER:
|
||||
LAVENDER_BLUSH:
|
||||
LAWN_GREEN:
|
||||
LEMON_CHIFFON:
|
||||
LIGHT_BLUE:
|
||||
LIGHT_CORAL:
|
||||
LIGHT_CYAN:
|
||||
LIGHT_GOLDENROD_YELLOW:
|
||||
LIGHT_GRAY:
|
||||
LIGHT_GREEN:
|
||||
LIGHT_PINK:
|
||||
LIGHT_SALMON:
|
||||
LIGHT_SEA_GREEN:
|
||||
LIGHT_SKY_BLUE:
|
||||
LIGHT_SLATE_GRAY:
|
||||
LIGHT_STEEL_BLUE:
|
||||
LIGHT_YELLOW:
|
||||
LIME:
|
||||
LIME_GREEN:
|
||||
LINEN:
|
||||
MAGENTA:
|
||||
MAROON:
|
||||
MEDIUM_AQUAMARINE:
|
||||
MEDIUM_BLUE:
|
||||
MEDIUM_ORCHID:
|
||||
MEDIUM_PURPLE:
|
||||
MEDIUM_SEA_GREEN:
|
||||
MEDIUM_SLATE_BLUE:
|
||||
MEDIUM_SPRING_GREEN:
|
||||
MEDIUM_TURQUOISE:
|
||||
MEDIUM_VIOLET_RED:
|
||||
MIDNIGHT_BLUE:
|
||||
MINTCREAM:
|
||||
MISTY_ROSE:
|
||||
MOCCASIN:
|
||||
NAVAJO_WHITE:
|
||||
NAVY:
|
||||
OLD_LACE:
|
||||
OLIVE:
|
||||
OLIVE_DRAB:
|
||||
ORANGE:
|
||||
ORANGE_RED:
|
||||
ORCHID:
|
||||
PALE_GOLDENROD:
|
||||
PALE_GREEN:
|
||||
PALE_TURQUOISE:
|
||||
PALE_VIOLET_RED:
|
||||
PAPAYA_WHIP:
|
||||
PEACH_PUFF:
|
||||
PERU:
|
||||
PINK:
|
||||
PLUM:
|
||||
POWDER_BLUE:
|
||||
PURPLE:
|
||||
RED:
|
||||
ROSY_BROWN:
|
||||
ROYAL_BLUE:
|
||||
SADDLE_BROWN:
|
||||
SALMON:
|
||||
SANDY_BROWN:
|
||||
SEA_GREEN:
|
||||
SEASHELL:
|
||||
SIENNA:
|
||||
SILVER:
|
||||
SKY_BLUE:
|
||||
SLATE_BLUE:
|
||||
SLATE_GRAY:
|
||||
SNOW:
|
||||
SPRING_GREEN:
|
||||
STEEL_BLUE:
|
||||
TAN:
|
||||
TEAL:
|
||||
THISTLE:
|
||||
TOMATO:
|
||||
TURQUOISE:
|
||||
VIOLET:
|
||||
WHEAT:
|
||||
WHITE:
|
||||
WHITE_SMOKE:
|
||||
YELLOW:
|
||||
YELLOW_GREEN:
|
||||
red:
|
||||
access: readonly
|
||||
green:
|
||||
|
||||
@@ -95,8 +95,8 @@ class ColorTest {
|
||||
assertEquals(0.0, color.green, 1e-2);
|
||||
assertEquals(0.0, color.blue, 1e-2);
|
||||
|
||||
// with k prefix
|
||||
color = Color.fromString("kRed");
|
||||
// as caps
|
||||
color = Color.fromString("RED");
|
||||
|
||||
assertEquals(1.0, color.red, 1e-2);
|
||||
assertEquals(0.0, color.green, 1e-2);
|
||||
|
||||
Reference in New Issue
Block a user