Add Colors namespace and missing enums#363
Merged
RobLoach merged 4 commits intoRobLoach:masterfrom Jun 10, 2025
mikomikotaishi:master
Merged
Add Colors namespace and missing enums#363RobLoach merged 4 commits intoRobLoach:masterfrom mikomikotaishi:master
RobLoach merged 4 commits intoRobLoach:masterfrom
mikomikotaishi:master
Conversation
Add Colors namespace that re-exports macros as constexpr
RobLoach
reviewed
Jun 10, 2025
Comment on lines
+13
to
+38
| #undef LIGHTGRAY | ||
| #undef GRAY | ||
| #undef DARKGRAY | ||
| #undef YELLOW | ||
| #undef GOLD | ||
| #undef ORANGE | ||
| #undef PINK | ||
| #undef RED | ||
| #undef MAROON | ||
| #undef GREEN | ||
| #undef LIME | ||
| #undef DARKGREEN | ||
| #undef SKYBLUE | ||
| #undef BLUE | ||
| #undef DARKBLUE | ||
| #undef PURPLE | ||
| #undef VIOLET | ||
| #undef DARKPURPLE | ||
| #undef BEIGE | ||
| #undef BROWN | ||
| #undef DARKBROWN | ||
| #undef WHITE | ||
| #undef BLACK | ||
| #undef BLANK | ||
| #undef MAGENTA | ||
| #undef RAYWHITE |
Owner
There was a problem hiding this comment.
Will Undef-ing these break implementations that use RAYWHITE and others? We want to add C++ wrappers, while still being able to use the original raylib codes.
Contributor
Author
There was a problem hiding this comment.
It should not as they were undef-ed after the inclusion of the file, so all the implementations will still have access to those macros. That being said we have to undef the macros so that they don't overwrite the constexpr ::Colors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a followup to a previous commit of mine, #360. It adds the colour macros in namespace
raylib::Colorsand makes themconstexpr(as modules cannot export macros). I also added enums that I forgot to export in the module.