mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-31 03:09:17 -05:00
Review Fade() functionality
This commit is contained in:
@ -81,7 +81,7 @@
|
|||||||
#define SUPPORT_DEFAULT_FONT
|
#define SUPPORT_DEFAULT_FONT
|
||||||
#define SUPPORT_MOUSE_GESTURES
|
#define SUPPORT_MOUSE_GESTURES
|
||||||
#define SUPPORT_CAMERA_SYSTEM
|
#define SUPPORT_CAMERA_SYSTEM
|
||||||
//#define SUPPORT_GESTURES_SYSTEM
|
#define SUPPORT_GESTURES_SYSTEM
|
||||||
#define SUPPORT_BUSY_WAIT_LOOP
|
#define SUPPORT_BUSY_WAIT_LOOP
|
||||||
#define SUPPORT_GIF_RECORDING
|
#define SUPPORT_GIF_RECORDING
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
@ -1109,9 +1109,7 @@ Color Fade(Color color, float alpha)
|
|||||||
if (alpha < 0.0f) alpha = 0.0f;
|
if (alpha < 0.0f) alpha = 0.0f;
|
||||||
else if (alpha > 1.0f) alpha = 1.0f;
|
else if (alpha > 1.0f) alpha = 1.0f;
|
||||||
|
|
||||||
float colorAlpha = (float)color.a*alpha;
|
return (Color){color.r, color.g, color.b, (unsigned char)(255.0f*alpha)};
|
||||||
|
|
||||||
return (Color){color.r, color.g, color.b, (unsigned char)colorAlpha};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activate raylib logo at startup (can be done with flags)
|
// Activate raylib logo at startup (can be done with flags)
|
||||||
|
|||||||
Reference in New Issue
Block a user