How to make colors slightly different

I noticed how the light yellow bricks on the old happy home of Robloxia we’re slightly randomized, and I wanted to recreate that effect.


(You have to look close in this picture)

I already tried this but it didn’t work:

script.Parent.Color = Color3.fromRGB(script.Parent.Color.R + math.random(-10,10), script.Parent.Color.G + math.random(-10,10), script.Parent.Color.B + math.random(-10,10))

When you’re accessing a bricks color by doing: script.Parent.Color.R it will return it 0-1 I believe instead of 0-255.

You can try:

local color = script.Parent.Color

script.Parent.Color = Color3.fromRGB(
    math.clamp(color.R * 255 + math.random(-10, 10), 0, 255),
    math.clamp(color.G * 255 + math.random(-10, 10), 0, 255),
    math.clamp(color.B * 255 + math.random(-10, 10), 0, 255)
)

Just adding onto this… from what I’m seeing they are just using 2 different colors (#b3a978 and #afa477 - I got from image color picker lol) so why not just do:

script.Parent.Color = [Color3.fromRGB(179,169,120), Color3.fromRGB(175, 164, 119)][math.random(1, 2)]

Random texture or color .. looks like what’s I’m seeing here. Could also hand do that.. I would.