Ad
Log in to vote
1

How do I convert a Color3 Value to a RGB Value?

Asked by 8 days ago

So, let's say I would want to get the Red value from a Part. I would use this code:

print(game.Workspace.TestPart.Color.r)

And it would output a number like "0.1234321" or something like that.... But how would I make it so that it prints out a RGB value from 0 - 255 instead of a Color3 Value 0 - 1?

0
Do you mean BrickColor to RGB value? Mineloxer 56 — 8d

Hi.

Looks like you're using an ad blocker.

That's fine...

No, it really is.

Just, I mean, we put a lot of work into this site, you know?

It would be really really appreciated if you would turn off your ad blocker for our website...

We tried really hard to make our ads as unobtrusive as possible.

If you really hate ads, would you consider a $2 donation via Patreon?

Here's the link.

We love you. We hope you love us too.

.

..

...

Now back to your regularly scheduled Scripting Helpers....

...

..

.

1 answer

Log in to vote
4
Answered by
CootKitty 296
8 days ago

Just multiply the value by 255.

print(game.Workspace.TestPart.Color.r*255)
0
Oh wow, didn't think of that... Thank's! MRbraveDragon 46 — 8d
Ad

Answer this question



Ad