Color3
values operate on a 0-1
scale. The 0-255
scale is for RGB (Red/Green/Blue) values.
If you want to use the RGB scale to create a Color3 value, use the Color3.fromRGB()
constructor (I forgot about this at the time of making my post, thank you @colbert2677 for reminding me).
Additionally, keep in mind that BrickColor.new(R, G, B)
will create the closest BrickColor
Code to the value that was input (although this will be on a 0-1 scale rather than the 0-255 scale). The RGB values for each existing BrickColor
Code can be found on this Roblox Creator Documentation page.
Note
(At the time of editing this comment on January 26th, 2022, to add Example #2, this behavior doesn’t appear to be working properly. Most RGB values that I’ve input to the BrickColor.new() constructor results in “Institutional White” with an RGB value of “248, 248, 248”, even if one of the values is 1 off from a completely different BrickColor Code).
After coming back to this comment on February 9th, 2023, I’m still observing the same behavior…
(Update on April 1st 2024)
I decided to revisit this, and it turns out that the behavior of using BrickColor.new()
with 3 sets of numbers (rather than a specific BrickColor code) is actually meant to be based on a 0-1 scale rather than 0-255. That’s why when I input anything above 1 for each of the values, it immediately turned into “Institutional White”, which has the values of [0.973, 0.973, 0.973]. It feels unintuitive, though, because that format resembles Color3
more than BrickColor
.
If you are looking to update the part’s Color
to the exact RGB values on the 0-255 scale, it’s recommended to utilize Color3.fromRGB()
, instead. Examples can be found below:
Example 1
local part1 = workspace.Part1
local part2 = workspace.Part2
part1.BrickColor = BrickColor.new(255, 0, 0)
part2.Color = Color3.fromRGB(255, 0, 0)
--[[
These two lines of code will result in the same color because a BrickColor code
with (255, 0, 0) as its RGB components exist (the color is called "Really Red")
--]]
Example 2
local part1 = workspace.Part1
local part2 = workspace.Part2
part1.BrickColor = BrickColor.new(110, 105, 22)
part2.Color = Color3.fromRGB(110, 105, 22)
--[[
This will result in different colors because a BrickColor Code
with (110, 105, 22) as its RGB components does not exist.
While part2 would have the exact RGB components of (110, 105, 22),
part1's Color value would round to that of the "Institutional White"
BrickColor Code. This is because using BrickColor.new(R, G, B) to create
a color that isn't defined as an existing BrickColor Code will
automatically round to the nearest BrickColor Code based on a 0-1 scale
rather than 0-255, for some reason.
"Institutional White" is said to have an RGB Value of [0.973, 0.973, 0.973],
so if you try to use BrickColor.new(R, G, B) with all 3 values greater than 1,
it'll probably select that color every time. It feels a bit unintuitive that it
doesn't use the 0-255 scale in that case, so I would recommend using
Color3.fromRGB(R, G, B) to get the specific RGB values you're looking for.
--]]