Make color darker with code

I am wanting to make a color darker when I pass through a Color3 value. This doesn’t seem to actually change the color whatsoever

local function MakeDarker(color)
	local H, S, V = color:ToHSV()
	
	V = math.clamp(V - 0.5, 0, 1)
	
	return Color3:fromHSV(H, S, V)
end

I’ve looked here, but didn’t really help a lot

2 Likes

It’s Color3.fromHSV not Color3:fromHSV.

3 Likes

What I am doing is valid
image

Either

local H, S, V = color:ToHSV()
-- or
local H, S, V = Color3.toHSV(color)

work the exact same

That’s a toHSV function. I am talking about fromHSV that you passed as your return value.

2 Likes

:man_facepalming: it’s late :sweat_smile: cheers!! works now

1 Like

Do

local color = -- standard color
local black = Color3.new(0,0,0)
local amount = 0.1

local darker_color = color:Lerp(black, amount)
8 Likes