Class ColorMatch

java.lang.Object
com.revrobotics.ColorMatch

public class ColorMatch extends Object
  • Constructor Details

  • Method Details

    • addColorMatch

      public void addColorMatch(edu.wpi.first.wpilibj.util.Color color)
      Add color to match object
      Parameters:
      color - color to add to matching
    • setConfidenceThreshold

      public void setConfidenceThreshold(double confidence)
      Set the confidence interval for determining color. Defaults to 0.95
      Parameters:
      confidence - A value between 0 and 1
    • matchColor

      public ColorMatchResult matchColor(edu.wpi.first.wpilibj.util.Color colorToMatch)
      MatchColor uses euclidean distance to compare a given normalized RGB vector against stored values
      Parameters:
      colorToMatch - color to compare against stored colors
      Returns:
      Matched color if detected, returns null if no color detected confidence level
    • matchClosestColor

      public ColorMatchResult matchClosestColor(edu.wpi.first.wpilibj.util.Color color)
      MatchColor uses euclidean distance to compare a given normalized RGB vector against stored values
      Parameters:
      color - color to compare against stored colors
      Returns:
      Closest color to match