diff options
| author | Ray <[email protected]> | 2024-05-21 20:52:48 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2024-05-21 20:52:48 +0200 |
| commit | 3abb6d9eaf9565cc3ae47687d85bfd392c982fb4 (patch) | |
| tree | 625b505a879fb6b19f22e98898665512f2bdff93 /src | |
| parent | c7f098f4d26753367c33743557c0db016eac25eb (diff) | |
| download | raylib-3abb6d9eaf9565cc3ae47687d85bfd392c982fb4.tar.gz raylib-3abb6d9eaf9565cc3ae47687d85bfd392c982fb4.zip | |
REVIEWED: `ColorToInt()` PR
Diffstat (limited to 'src')
| -rw-r--r-- | src/rtextures.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rtextures.c b/src/rtextures.c index ca4c60d1..571387f2 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -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] |
