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

How do you convert BrickColor to Color3?

Why does the following code not actually return a proper Color3 value that is the same as the brick color?:

local brickcolor = BrickColor.new("Really red")
local color = brickcolor.Color

1 comment

1

Use BrickColorValueHere.Color to convert to Color3

1 answer

BrickColors aren't the exact same as Color3 values. Color3 values range from 0 to 1 in 255 different shades in each R, G, B argument. However, BrickColors have a preset table of what they can be. In fact, you can see what this table looks like and all the BrickColors it stores, here.

Although, this is only a problem when converting a Color3 value, to a BrickColor. Since Color3 holds way more different color combinations than BrickColor, and BrickColor only holds a table of named colors, BrickColor will only choose the closest number it can find to your Color3 value in the table it has. This isn't usually a problem, but if you're looking for brick color tweening or something, it won't look smooth.

Summary

BrickColor to Color3 conversions will always be accurate, but Color3 to BrickColor conversions may seem a bit off sometimes. But in the code you provided, it does return the Color3 version of BrickColor "Really red" accurately.

4 comments

0

You didn't actually tell him how, though...

2

Because he already did, there is nothing wrong with his code.

1

The why he asked the question

0

The link is broken

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