{"record":{"id":"e0dbb57f1a870242","repo":"roboflow/supervision","slug":"rgba-values-must-be-in-range-0-255-got-r-g","errorCode":null,"errorMessage":"RGBA values must be in range 0-255, got ({r}, {g}, {b}, {a})","messagePattern":"RGBA values must be in range 0-255, got \\((.+?), (.+?), (.+?), (.+?)\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/draw/color.py","lineNumber":240,"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 RGBA value is outside the range 0-255.\n\n        Example:\n            ```pycon\n            >>> import supervision as sv\n            >>> sv.Color.from_rgba_tuple((255, 255, 0, 128))\n            Color(r=255, g=255, b=0, a=128)\n\n            ```\n        \"\"\"\n        r, g, b, a = color_tuple\n        if not (0 <= r <= 255 and 0 <= g <= 255 and 0 <= b <= 255 and 0 <= a <= 255):\n            raise ValueError(\n                f\"RGBA values must be in range 0-255, got ({r}, {g}, {b}, {a})\"\n            )\n        return cls(r=r, g=g, b=b, a=a)\n\n    @classmethod\n    def from_bgra_tuple(cls, color_tuple: tuple[int, int, int, int]) -> Color:\n        \"\"\"\n        Create a Color instance from a BGRA tuple.\n\n        Args:\n            color_tuple: A tuple representing the color in BGRA 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 BGRA value is outside the range 0-255.","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/draw/color.py#L222-L258","documentation":"Error \"RGBA values must be in range 0-255, got ({r}, {g}, {b}, {a})\" thrown in roboflow/supervision.","triggerScenarios":"Thrown at src/supervision/draw/color.py:240 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass r, g, b, a values each between 0 and 255 to Color.from_rgba.","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"}