{"record":{"id":"c180de76c3a5df35","repo":"roboflow/supervision","slug":"rgb-values-must-be-in-range-0-255-got-r-g","errorCode":null,"errorMessage":"RGB values must be in range 0-255, got ({r}, {g}, {b})","messagePattern":"RGB values must be in range 0-255, got \\((.+?), (.+?), (.+?)\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/draw/color.py","lineNumber":184,"sourceCode":"                element is an integer in the range 0-255.\n\n        Returns:\n            An instance representing the color.\n\n        Raises:\n            ValueError: If any RGB value is outside the range 0-255.\n\n        Example:\n            ```pycon\n            >>> import supervision as sv\n            >>> sv.Color.from_rgb_tuple((255, 255, 0))\n            Color(r=255, g=255, b=0)\n\n            ```\n        \"\"\"\n        r, g, b = color_tuple\n        if not (0 <= r <= 255 and 0 <= g <= 255 and 0 <= b <= 255):\n            raise ValueError(f\"RGB values must be in range 0-255, got ({r}, {g}, {b})\")\n        return cls(r=r, g=g, b=b)\n\n    @classmethod\n    def from_bgr_tuple(cls, color_tuple: tuple[int, int, int]) -> Color:\n        \"\"\"\n        Create a Color instance from a BGR tuple.\n\n        Args:\n            color_tuple: A tuple representing the color in BGR format, where each\n                element is an integer in the range 0-255.\n\n        Returns:\n            An instance representing the color.\n\n        Raises:\n            ValueError: If any BGR value is outside the range 0-255.\n\n        Example:","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/draw/color.py#L166-L202","documentation":"Error \"RGB values must be in range 0-255, got ({r}, {g}, {b})\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/draw/color.py:184 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass r, g, b values each between 0 and 255 to Color.from_rgb.","Validate or clamp values before calling if they come from an external source."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7f254d9784d4c37e0f03cd89ddee164c8db099c0","analyzedAt":"2026-08-15T05:13:01.950Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}