Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
INOOBE_YT 387 Moderation Voter
6 years ago

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
I think you do something like local h, s, v = Color3.toHSV(color) steven73598233 75 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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)
Ad

Answer this question