Skip to content

Commit

Permalink
REVIEWED: ColorToInt() PR
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed May 21, 2024
1 parent c7f098f commit 3abb6d9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/rtextures.c
Original file line number Diff line number Diff line change
Expand Up @@ -4510,7 +4510,14 @@ Color Fade(Color color, float alpha)
// Get hexadecimal value for a Color
int ColorToInt(Color color)
{
return (int)(((unsigned)color.r << 24) | ((unsigned)color.g << 16) | ((unsigned)color.b << 8) | color.a);
int result = 0;

result = (int)(((unsigned int)color.r << 24) |
((unsigned int)color.g << 16) |
((unsigned int)color.b << 8) |
(unsigned int)color.a);

return result;
}

// Get color normalized as float [0..1]
Expand Down

0 comments on commit 3abb6d9

Please sign in to comment.