UIGradient
Apply a color and transparency gradient to a GUI element.
UIGradient is a UI modifier that tints its parent with a color sequence and an optional transparency sequence. The gradient is drawn across the parent using a rotation and offset.
Getting started
local gradient = Instance.new("UIGradient")
gradient.Color = ColorSequence.new({
ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 180, 80)),
ColorSequenceKeypoint.new(1, Color3.fromRGB(120, 50, 200)),
})
gradient.Rotation = 90
gradient.Parent = frameProperties
| Property | Type | Access | Description |
|---|---|---|---|
Enabled | boolean | Read/write | Whether the gradient renders. |
Color | ColorSequence | Read/write | Color ramp. |
Transparency | NumberSequence | Read/write | Alpha ramp. |
Rotation | number | Read/write | Gradient angle in degrees. |
Offset | Vector2 | Read/write | Shifts the gradient along its axis. |
Notes
- The gradient needs at least two keypoints in both
ColorandTransparencyto render. - Assigning a sequence copies it; later edits to the source don't affect the modifier.
Rotationis in degrees and accepts any number, including values beyond360.- Cloning copies both sequences and the offset.
See also
UICornerandUIStrokefor other modifiers.ColorSequenceValueandNumberSequenceValuefor reusable sequences.
