diff --git a/src/raylib.h b/src/raylib.h index 28f052c7f..f9ac7fa15 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1401,6 +1401,7 @@ RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle // Color/pixel related functions RLAPI Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f RLAPI int ColorToInt(Color color); // Get hexadecimal value for a Color +RLAPI Color ColorFromInt(unsigned int hexValue); // Get Color structure from hexadecimal value RLAPI Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1] RLAPI Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1] RLAPI Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1] diff --git a/src/rtextures.c b/src/rtextures.c index 8742b0c9c..7c767a14a 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -4437,6 +4437,12 @@ int ColorToInt(Color color) return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); } +// Get Color structure from hexadecimal value +Color ColorFromInt(unsigned int hexValue) +{ + return GetColor(hexValue); +} + // Get color normalized as float [0..1] Vector4 ColorNormalize(Color color) {