function GetContrastColor(bgColor)
local brightness = (bgColor.R * 299 + bgColor.G * 587 + bgColor.B * 114) / 1000
if brightness > 0.5 then
return Color3.new(0, 0, 0) -- black for light backgrounds
else
return Color3.new(1, 1, 1) -- white for dark backgrounds
end
end
Basically, Returns a color. Imputing a color3, will return the color properly.
(CORRECTED A MISTAKE WHEN POSTING.