mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 03:18:14 +00:00
REVIEWED: ColorToInt()
PR
This commit is contained in:
@@ -4510,7 +4510,14 @@ Color Fade(Color color, float alpha)
|
|||||||
// Get hexadecimal value for a Color
|
// Get hexadecimal value for a Color
|
||||||
int ColorToInt(Color 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]
|
// Get color normalized as float [0..1]
|
||||||
|
Reference in New Issue
Block a user