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

BackgroundColor3 = 255, 255, 255 but printing 1, 1, 1?

Asked by
LawlR 182
5 years ago
Edited 5 years ago

No matter what I do, it prints 1, 1, 1 even though in the properties tab it shows that its 255, 255 ,255. I've tried Color3.fromRGB, tostring, tonumber, pretty much everything but it never prints its actual value. Can I have some help please?

print(Color3.fromRGB(game.StarterGui.Main.ColourPicker.Frame["Black/White"].White.BackgroundColor3))
> 0, 0, 0
print(game.StarterGui.Main.ColourPicker.Frame["Black/White"].White.BackgroundColor3)
> 1, 1, 1
print(tostring(game.StarterGui.Main.ColourPicker.Frame["Black/White"].White.BackgroundColor3))
> 1, 1, 1
0
I believe this is a roblox error. Experienced the same thing a few months back. Let me know if you find something. oftenz 367 — 5y
0
Damn it. I've got an exam tomorrow and I'm trying to fix an unfixable thing. LawlR 182 — 5y
0
Divide by 255? I got the same glitch! I believe I did find a post that told me to divide 255 from x,y,z.... I would rather use brick colors though or at least hexadecimals. greatneil80 2647 — 5y
0
actually, the color 3 thing is weird you do divide by 255 idk why but it will get you the right color (still prints 1,1,1) or some small number OBenjOne 190 — 5y
View all comments (3 more)
1
multiply the print by 255 and it will print right OBenjOne 190 — 5y
0
I’m assuming ROBLOX stores it always in a Color.new form, even with what you did with Color.fromRGB (Which isn’t good). If u have an exam on this sorta thing, explain that the Color.new value of 1,1,1 is the same as Color.fromRGB 255, 255, 255 on ROBLOX. Lugical 425 — 5y
1
This is not an error, or particularly unique. Internally, a Color3's rgb values are always in range [0,1]. What you're entering in the property panel is actually a string, which is parsed and converted via Color3.fromRGB(). Something similar happens with Orientation, which takes degrees but will return values in Radians. EmilyBendsSpace 1025 — 5y

Answer this question