As a Roblox developer, it is currently too hard to create random Color3 values in a clean way.
If Roblox is able to address this issue, it would improve my development experience because it would greatly improve my scripting flow when creating random colors.
Currently to create random colors I must type the following line: Color3.new(math.random(), math.random(), math.random())
This is repetitive and makes things much harder to read when you have lots of code.
I propose that something along the lines of Color3.random([minHue], [maxHue], [minSat], [maxSat], [minVal], [maxVal])
be implemented. This allows full control of the appearance of output colors and makes things much quicker since you now only need to type Color3.random()
to create a random color.
This greatly reduces clutter in code that uses random colors and makes things much more readable especially because itâs much less repetitive and isnât as easily confused with other similar lines.
Example uses:
-- Black and white noise
Color3.random(0, 0, 0, 0, 0, 1) -- 0-0 hue, 0-0 saturation (bw), 0-1 value
-- Fully saturated noise
Color3.random(0, 1, 1, 1, 0, 1)
-- Random shade of green
Color3.random(0.43, 0.43, 1, 1, 0, 1)