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

Why am I getting a clearly incorrect output from Color3?

So I am simply trying to change the color 3 value of a brick and I am so confused. Every time I go to change it to a color it set itself to black. So I set a variable up for each color channel to see if I can find a problem, and I have.

I have a brick with a Color3Value and a Script in it. The Color3Value is set to 255,255,255 and here is the script's content:

red = (script.Parent.Var.Value.r/255)
green = (script.Parent.Var.Value.g/255)
blue = (script.Parent.Var.Value.b/255)
script.Parent.Color = Color3.new(red,green,blue)
print(red)

In theory, each variable should turn out as one, as 255 / 255 = 1, but according to the Output after I print "red", 255 / 255 = 0.003921568627451

I am so absurdly confused.

Proof that I am not going insane.

1 answer

✓ Accepted answer

That because the Value that it is, is already 1, not 255.

1/255 = .00392515

so try taking away the 255 maybe?

1 comment

0

Yep, works perfectly. Thank you.

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