Pipeline: Fix bug where multiple entities were assigned the same color during batch coloring
@@ -81,7 +81,10 @@ def add_color_macros(tex: str, after_macros: Optional[str] = None) -> str:
# TODO(andrewhead): determine number of hues based on the number of hues that OpenCV is capable
# of distinguishing between. Current value is a guess.
NUM_HUES = 30
-HUES = np.linspace(0, 1, NUM_HUES)
+
+# Don't include both 0 and 1 as hues, because hue is radial. Therefore, 0 and 1 are the same
+# hue, meaning that two entities with 0 and 1 as hues would be detected as the same entity.
+HUES = np.linspace(0, 1 - (1.0 / NUM_HUES), NUM_HUES)
def generate_hues() -> Iterator[float]:
