# Sandbox.SliderGradientAttribute

Draws a numeric slider's track as a color gradient instead of highlighting the filled portion.
Use with [Sandbox.RangeAttribute](/api/Sandbox.RangeAttribute), for example [SliderGradient( "#0ff", "#0aa", "#ff0" )].

- Kind: attribute
- Namespace: `Sandbox`
- Assembly: `Sandbox.System`
- Modifiers: sealed

## Constructors

- [`SliderGradientAttribute`](/api/Sandbox.SliderGradientAttribute/.ctor): Creates a gradient with colors spaced evenly from the minimum to the maximum slider value.

## Properties

- [`Colors`](/api/Sandbox.SliderGradientAttribute/Colors): Colors along the track, using the same strings as [Color.Parse](/api/Color/Parse).
- [`Positions`](/api/Sandbox.SliderGradientAttribute/Positions): Optional positions from zero to one, with one position per color. All colors are evenly spaced when omitted or when the position count differs from the color count. Otherwise, non-finite positions individually fall back to even spacing. Positions are clamped and sorted; endpoint colors extend to the track edges.

## Methods

- [`CreateGradient`](/api/Sandbox.SliderGradientAttribute/CreateGradient): Builds the track gradient using the placement and fallback rules of [Sandbox.SliderGradientAttribute.Positions](/api/Sandbox.SliderGradientAttribute/Positions). An empty color list leaves the slider's usual track unchanged.
