Skip to content

Conversation

Shriya613
Copy link

 ## Description
 This PR adds validation for RGB/BGR color values in the `Color` class to ensure they are within the valid range (0-255).

 ## Changes
 - Added range validation (0-255) to `Color.from_rgb_tuple()` and `Color.from_bgr_tuple()`
 - Raise `ValueError` for invalid color values with descriptive error messages
 - Added comprehensive tests for both valid and invalid cases
 - Updated docstrings to document the new validation behavior

 ## Testing
 - Added test cases for valid RGB/BGR tuples
 - Added test cases for invalid RGB/BGR tuples (out of range values)
 - All tests pass

 ## Related Issues
 Fixes potential issues where invalid color values could cause unexpected behavior in annotators.

- Add range validation (0-255) to from_rgb_tuple() and from_bgr_tuple()
- Raise ValueError for invalid color values with descriptive messages
- Add comprehensive tests for both valid and invalid cases
- Update docstrings to document the new validation behavior
@Shriya613 Shriya613 requested a review from SkalskiP as a code owner October 7, 2025 21:47
@CLAassistant
Copy link

CLAassistant commented Oct 7, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants