Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to get the Hue, Saturation, or Value from a Color3?

When using Color3.toHSV, it returns all 3 of them. I only want one of the values. For example, you can do:

print(Color3.new(1,1,1).r)

and it will return just the red value of the Color3. I want to do this, but with the toHSV function. How would I do this?

1 comment

1

I think you do something like local h, s, v = Color3.toHSV(color)

1 answer

✓ Accepted answer

defining multiple returned values at a time will be assigned to their respective variables kind of like how you would do

k,v in pairs()

for a for loop:

local Hue, Saturation, Value = Color3.toHSV(<Color3>)
print("Hue:" .. Hue .. "\nSat:" .. Saturation .. "\nValue:" .. Value)

This discussion is preserved as it was. New answers, comments, and votes are closed.