Part.Color not giving an RGB value?

Parts have the Color property as an RGB value to my knowledge, but when running this code on a Baseplate with the Color property as “99, 95, 98”

print(workspace.Baseplate.Color)

I get this result

0.388235, 0.372549, 0.384314

I know that this is the RGB value from 0-1, but I need to RGB value from 0 - 255, does anyone know why this issue is occurring and if there are any workarounds?

How about you try getting its brickColor

Can’t do that as I need the Color3 for tweening
Edit: Just noticed that you can still tween with the “Raw” rgb values

It is giving you the color RGB.

0.388235, 0.372549, 0.384314 = 99/255, 95/255, 98/255

Is there any way for me to get the RGB “out of 255” I suppose

Wait 99/55 isnt 0.388235; how is that right?

You can multiply it by 255.

Color.R * 255, Color.G * 255, Color.B * 255
4 Likes

Bruh

1 Like

Oh I guess I read that wrong I thought it said 55, my bad :cowboy_hat_face:

Thank you, didn’t really come to mind. This does give me a decimal number though since the number rounds, suppose I wanted to get the same Color3 value that is listed under the properties, what would I do?

You can either use math.ceil to get the nearest full number rounded up or math.floor to get the nearest full number rounded down.

1 Like

Or use math.floor(N + 0.5) for accurate rounding.

or use math.round which is available in Luau for even more “accurate” rounding.

2 Likes

Wouldn’t see how math.floor or math.ceil could be inaccurate but yeah you can do that too.

or use math.modf which doesnt round but gives the number without the . and numbers after .

Yeah another possible solution.