LavaUI docs GitHub

struct SliderStyle

Swift

struct SliderStyle

Colours and metrics for a Slider.

Sources/LavaUI/Slider.swift:210

Constructors

init(trackWidth: Float = 140, trackThickness: Float = 4, knobRadius: Float = 7, knobHoverScale: Float = 1.25, activeTrack: Color? = nil, inactiveTrack: Color? = nil, knob: Color? = nil, disabledTrack: Color? = nil, disabledKnob: Color? = nil, foreground: Color? = nil, disabledForeground: Color? = nil, valueGap: Float = 8, valueWidth: Float = 44, duration: Double = 0.1)

Creates a style. Colours left nil come from the current theme.

Sources/LavaUI/Slider.swift:242

Properties

var activeTrack: Color

The track to the left of the knob, the part that is "filled".

Sources/LavaUI/Slider.swift:220

var disabledForeground: Color

Colour of the readout while disabled.

Sources/LavaUI/Slider.swift:232

var disabledKnob: Color

Colour of the knob while disabled.

Sources/LavaUI/Slider.swift:228

var disabledTrack: Color

Colour of the whole track while disabled.

Sources/LavaUI/Slider.swift:226

var duration: Double

How long the knob takes to grow or shrink on hover, in seconds.

Sources/LavaUI/Slider.swift:239

var foreground: Color

Colour of the readout.

Sources/LavaUI/Slider.swift:230

var inactiveTrack: Color

The track to the right of the knob.

Sources/LavaUI/Slider.swift:222

var knob: Color

Colour of the knob.

Sources/LavaUI/Slider.swift:224

var knobHoverScale: Float

Knob size multiplier while hovered or dragged.

Sources/LavaUI/Slider.swift:218

var knobRadius: Float

Radius of the knob at rest, in points.

Sources/LavaUI/Slider.swift:216

var trackThickness: Float

Thickness of the track, in points.

Sources/LavaUI/Slider.swift:214

var trackWidth: Float

Track length when nothing stretches it.

Sources/LavaUI/Slider.swift:212

var valueGap: Float

Space between the track and the readout, in points.

Sources/LavaUI/Slider.swift:234

var valueWidth: Float

Space reserved for the readout, wide enough that its text changing width cannot resize the track mid-drag.

Sources/LavaUI/Slider.swift:237