Add color to string usage example - #787
Conversation
❌ Deploy Preview for splashkit failed.
|
jankiluitel
left a comment
There was a problem hiding this comment.
Great work on this PR! The usage examples are well structured and consistent across C++, Python, and C# implementations. I especially liked that each example demonstrates a practical use case rather than just calling the function in isolation. The accompanying images/GIFs and description files make the examples much easier for new users to understand, and the code is clean, readable, and well commented.
One small suggestion would be to keep comments and terminology completely consistent across all language implementations where possible. For example, ensuring the function descriptions and wording match exactly between C++, Python, and C# would improve consistency for learners switching between languages. Other than that, I didn't notice any major issues, and the changes look ready for review. Great job!
Approved. The implementation is clear, consistent, and meets the expected documentation and usage example standards. Nice work!
himanshigaba22
left a comment
There was a problem hiding this comment.
This PR bundles four separate usage examples—alpha_of, color_to_string, move_mouse_to_point, and timer_started—but the PR title and description only refer to color_to_string. Could these be split into separate PRs, or alternatively could the title and description be updated to clearly reflect everything included? Keeping each PR focused would make review, testing, and any follow-up changes much easier to track.
A couple of specific points:
In the move_mouse_to_point example, the C++ and C# versions call move_mouse, while the Python version calls move_mouse_to_point. Could you please confirm whether these map to the same underlying function, such as an overload that Python exposes under a different name?
The testing section currently only mentions verifying the color_to_string example. Could you also confirm that the alpha_of, move_mouse_to_point, and timer_started examples were compiled or run successfully in their supported languages?
The examples themselves are clear and practical, but clarifying the PR scope and testing coverage would make the contribution easier to review and maintain.
ralphweng2023
left a comment
There was a problem hiding this comment.
Picking up the move_mouse question from himanshigaba22 since it has been sitting since the 26th: they are the same function. api.json lists move_mouse_to_point with a cpp signature of move_mouse(point_2d point) and a python one of move_mouse_to_point(point), so C++ overloads on the argument type while Python gives the point version its own name. Both files are calling it correctly.
The scope point still stands though. Four examples across three categories under a title naming only color_to_string is hard to follow, and updating the title and description rather than splitting the PR looks like the cheaper of the two options offered. Please do one or the other before this merges.
Description
Adds a usage example for the
color_to_stringfunction in the color API category. The example draws five coloured rectangles (red, green, blue, orange, purple) and displays the hex string representation of each colour below its rectangle usingcolor_to_string.Type of change
Please delete options that are not relevant.
expected)
How Has This Been Tested?
Ran the example locally on macOS. Compiled and executed the C++ version using
skm clang++and verified the output window displayed all five rectangles with correct hex string values beneath each one.Testing Checklist
Checklist
Please delete options that are not relevant.
If involving code
If modified config files
Folders and Files Added/Modified
Please list the folders and files added/modified with this pull request and delete options that are not relevant.
Additional Notes
The example uses five named SplashKit colours to clearly demonstrate how
color_to_stringconverts a colour into its hex string format (#RRGGBBAA). A screenshot of the expected output is included.