Add HSB color usage example - #820
Conversation
❌ Deploy Preview for splashkit failed.
|
ekam313
left a comment
There was a problem hiding this comment.
The example runs well across all four language versions, and the HSB interaction works as expected. I found a few consistency/style points that could be improved before approval:
The value-clamping logic is implemented differently across the languages. C++ uses if statements, C# uses Math.Clamp, and Python uses max/min. Since usage examples should maintain a similar structure across languages and remain easy for beginners to compare, could this logic be made consistent across all versions?
The code files currently have no comments. A few short, consistent comments for the main logical sections, such as handling input, keeping HSB values within range, and displaying the generated colour, would improve readability for beginner users.
Apart from these points, the program functionality and interaction worked correctly during testing.
|
Appreciate the thorough review @ekam313. For the comments, that's fair, I've added a few section comments to each version. On the clamping consistency, I intentionally used each language's idiomatic approach. Math.Clamp is the standard way to do this in C#, and max/min is the natural Python pattern. Rewriting them all as if-statements would work, but it would make the C# and Python versions less representative of how you'd actually write that language. Since these examples are meant to teach SplashKit in the context of each language, I think showing the idiomatic approach is more useful than forcing identical structure. Happy to hear your thoughts on that though. |
Peer ReviewI've reviewed PR #820, Add HSB Color Usage Example, against the SplashKit Usage Example requirements and style guide. The example provides a clear and interactive demonstration of the Checks
Code Tests Done
Website Tests Done
The implementation is clear, beginner-friendly, and provides a useful demonstration of how HSB colour values can be manipulated interactively. Approved from my side. |
rachelpatrao
left a comment
There was a problem hiding this comment.
Looks good! The hsb_color usage example clearly demonstrates how hue, saturation, and brightness can be adjusted interactively, and the output is easy to understand. Everything looks good from my side. Happy to approve!
Description
Splashkit Function:
hsb_colorOverview of example functionality:
This example demonstrates how
hsb_colorcreates colors using hue, saturation, and brightness values. The user can interactively adjust each HSB component and immediately see the resulting color update on screen.Example Output:

Files Included
Usage Example Checks (READ CAREFULLY)