utils: Añadida la función randColor
This commit is contained in:
@@ -601,4 +601,14 @@ color_t lightenColor(color_t color, int amount)
|
||||
newColor.g = min(255, color.g + amount);
|
||||
newColor.b = min(255, color.b + amount);
|
||||
return newColor;
|
||||
}
|
||||
|
||||
// Obtiene un color aleatorio
|
||||
color_t randColor()
|
||||
{
|
||||
color_t newColor;
|
||||
newColor.r = rand() % 256;
|
||||
newColor.g = rand() % 256;
|
||||
newColor.b = rand() % 256;
|
||||
return newColor;
|
||||
}
|
||||
Reference in New Issue
Block a user