s&
About
The Project
infoAbout s&box mapRoadmap monitoringMetricsEngine startup and usage numbers
Updates
newspaperLatest News published_with_changesChangesRelease-by-release changelog
Games
Browse Games Discover Games
gamejams
Workshop
Playable
sports_esportsGamesStandalone games and gamemodes
Assets
landscapeMaps view_in_arModels textureMaterials apparelClothing
appsEverythingEvery asset type in one list
Forum
Learn
Documentation
rocket_launchGetting Started docsDocumentation apiAPI Reference
Resources
schoolTutorials manage_searchCode Search
Get s&box
Sign in with Steam
Api
Attributes
SliderGradientAttribute
chevron_left Attributes
attribute
SliderGradientAttribute

Constructors

functionsSliderGradientAttribute

Properties

data_objectColorsdata_objectPositions

Methods

functionsCreateGradient
SliderGradientAttribute
Draws a numeric slider's track as a color gradient instead of highlighting the filled portion. Use with Sandbox.RangeAttribute, for example [SliderGradient( "#0ff", "#0aa", "#ff0" )].
attribute Sandbox .
sealedSandbox.System

build Constructors 1

SliderGradientAttribute (colors)
Creates a gradient with colors spaced evenly from the minimum to the maximum slider value.

data_object Properties 2

Colors
String[]
Colors along the track, using the same strings as Color.Parse(System.String).
Positions
Single[]
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.

functions Methods 1

CreateGradient ()
Gradient
Builds the track gradient using the placement and fallback rules of Sandbox.SliderGradientAttribute.Positions. An empty color list leaves the slider's usual track unchanged.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
Facepunch
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter