Skip to Content
Kinemium

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 = frame

Properties

PropertyTypeAccessDescription
EnabledbooleanRead/writeWhether the gradient renders.
ColorColorSequenceRead/writeColor ramp.
TransparencyNumberSequenceRead/writeAlpha ramp.
RotationnumberRead/writeGradient angle in degrees.
OffsetVector2Read/writeShifts the gradient along its axis.

Notes

  • The gradient needs at least two keypoints in both Color and Transparency to render.
  • Assigning a sequence copies it; later edits to the source don't affect the modifier.
  • Rotation is in degrees and accepts any number, including values beyond 360.
  • Cloning copies both sequences and the offset.

See also

  • UICorner and UIStroke for other modifiers.
  • ColorSequenceValue and NumberSequenceValue for reusable sequences.

On this page