Hello developers! Basically, I am making a shine effect, and what is happening is that the BackgroundColor3 I am assigning to a UIGradient is darker than it should be. Here is the code and video:
local gradient = ui:FindFirstChild("UIGradient")
if not color then color = ui.BackgroundColor3 end
if not gradient then
gradient = Instance.new("UIGradient")
gradient.Parent = ui
gradient.Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, color),
ColorSequenceKeypoint.new(0.5, Color3.fromRGB(255, 255, 255)),
ColorSequenceKeypoint.new(1, color)
})
gradient.Rotation = 45
end
If you want to use a gradient with the same background color, then change the actual BackgroundColor3 to white, it should be lighter afterwards.
local gradient = ui:FindFirstChild("UIGradient")
if not color then color = ui.BackgroundColor3 end
if not gradient then
gradient = Instance.new("UIGradient")
gradient.Parent = ui
gradient.Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, color),
ColorSequenceKeypoint.new(0.5, Color3.fromRGB(255, 255, 255)),
ColorSequenceKeypoint.new(1, color)
})
gradient.Rotation = 45
ui.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
end
No, if you set the backgroundcolor3 to white, your gradient will override it and the tone will be unaffected because the shade is light. If you have a non-white backgroundcolor3, it will affect your gradient’s appearance.