Cover RGB and RGBA color APIs#91
Conversation
Covers RGB::from_f32, RGB::from_u8, tuple/RGBA conversions, RGB::to_rgba, and XpColor conversion behavior.
Covers RGB Add/Sub/Mul operators, greyscale/desaturate helpers, and RGB::lerp boundary and midpoint behavior.
Covers RGBA conversion from RGB, RGB/RGBA byte tuples, and f32 component arrays.
Covers RGBA Add/Sub/Mul operators, RGBA::lerp midpoint behavior, and RGBA::lerp_alpha alpha-only interpolation.
Separates RGB::from_f32, RGB::from_u8, tuple conversion, and RGBA conversion into API-specific tests for clearer failures.
📝 WalkthroughWalkthroughThe PR expands and restructures test coverage for ChangesColor Type Test Expansion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
utilForever
left a comment
There was a problem hiding this comment.
LGTM. Thanks for your work! 🎉
What
Add focused unit tests for RGB and RGBA color APIs, including construction, conversions, hex parsing edge cases, arithmetic, transforms, and Bevy feature conversions.
Why
RGB/RGBA color APIs lacked direct coverage for several public conversion and parsing paths. These tests document the expected component behavior and bring
rgb.rsandrgba.rsline coverage to 100% when the Bevy feature is enabled.Closes #89
Before
After
Checklist
Required
cargo check --allpassescargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warnings -A clippy::multiple-crate-versionspassescargo test --allpassesCloses #123)Functional Validation
Configuration & Docs
README.md,ARCHITECTURE.md, or relevant manual pages, if applicable)If Applicable
cargo auditlocally if needed)Verification
cargo check --allcargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warnings -A clippy::multiple-crate-versionscargo test --allcargo test -p bracket-color --features bevycargo llvm-cov -p bracket-color --features bevy --html --openSummary by CodeRabbit