Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ColorFromInt for convenance #3567

Closed
wants to merge 1 commit into from
Closed

add ColorFromInt for convenance #3567

wants to merge 1 commit into from

Conversation

danilwhale
Copy link
Contributor

because there's ColorFromNormalized -> ColorToNormalized, ColorFromHSV -> ColorToHSV

but GetColor -> ColorToInt, not ColorFromInt -> ColorToInt

@Peter0x44
Copy link
Contributor

Peter0x44 commented Nov 23, 2023

This is inconsistent.
GetColor returns int, while ColorToInt takes an unsigned int.
I think these functions are a little broken anyway, since the exact representation of (unsigned) int depends on endianness.
Probably they deserve a deeper review.

also, nit: convenance -> convenience.
At least I assume that's what you meant, "convenance" is not a thing.

@raysan5
Copy link
Owner

raysan5 commented Nov 23, 2023

@danilwhale I prefer to avoid that function duplicate, despite the consistency it could add. Same behaviour can be accomplished with a #define GetColor ColorFromInt but probably as @Peter0x44 commented all those functions mentioned should be reviewed, I don't like the reference to a specific language data type in the name of the functions, that's counter-productive for other language bindings. Naming for those functions should be reviewed.

@raysan5 raysan5 closed this Nov 23, 2023
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.

3 participants