[wpiutil] Move Color and Color8Bit from wpilib to wpiutil (#8437)

Removes one of the org.wpilib.util package conflicts for modularization.

Only a few minor tweaks were required to remove the wpimath dependency.
This commit is contained in:
Peter Johnson
2025-11-30 11:11:48 -08:00
committed by GitHub
parent e902a98601
commit 42992953ed
32 changed files with 468 additions and 385 deletions

View File

@@ -61,7 +61,9 @@ class Arm {
wpi::MechanismRoot2d* m_armBase = m_mech2d.GetRoot("ArmBase", 30, 30);
wpi::MechanismLigament2d* m_armTower =
m_armBase->Append<wpi::MechanismLigament2d>(
"Arm Tower", 30, -90_deg, 6, wpi::Color8Bit{wpi::Color::kBlue});
"Arm Tower", 30, -90_deg, 6,
wpi::util::Color8Bit{wpi::util::Color::kBlue});
wpi::MechanismLigament2d* m_arm = m_armBase->Append<wpi::MechanismLigament2d>(
"Arm", 30, m_armSim.GetAngle(), 6, wpi::Color8Bit{wpi::Color::kYellow});
"Arm", 30, m_armSim.GetAngle(), 6,
wpi::util::Color8Bit{wpi::util::Color::kYellow});
};

View File

@@ -66,7 +66,8 @@ class Robot : public wpi::TimedRobot {
m_root->Append<wpi::MechanismLigament2d>("elevator", 1, 90_deg);
wpi::MechanismLigament2d* m_wrist =
m_elevator->Append<wpi::MechanismLigament2d>(
"wrist", 0.5, 90_deg, 6, wpi::Color8Bit{wpi::Color::kPurple});
"wrist", 0.5, 90_deg, 6,
wpi::util::Color8Bit{wpi::util::Color::kPurple});
};
#ifndef RUNNING_WPILIB_TESTS