changed Color struct to 4 floats

GetRandomValue returns floats
added GetRandomInt
added Color4ub rgba 0-255
edited examples to work
colour palette values could bare a double check!
This commit is contained in:
Chris 2019-10-21 20:17:48 +01:00
commit b4d8f0b5d1

View file

@ -303,18 +303,18 @@ int main(int argc, char **argv)
static void RandomizeEmoji(void)
{
hovered = selected = -1;
int start = GetRandomValue(45, 360);
int start = GetRandomInt(45, 360);
for (int i = 0; i < SIZEOF(emoji); ++i)
{
// 0-179 emoji codepoints (from emoji char array) each 4bytes + null char
emoji[i].index = GetRandomValue(0, 179)*5;
emoji[i].index = GetRandomInt(0, 179)*5;
// Generate a random color for this emoji
Vector3 hsv = {(start*(i + 1))%360, 0.6f, 0.85f};
emoji[i].color = Fade(ColorFromHSV(hsv), 0.8f);
// Set a random message for this emoji
emoji[i].message = GetRandomValue(0, SIZEOF(messages) - 1);
emoji[i].message = GetRandomInt(0, SIZEOF(messages) - 1);
}
}