Skip to content

Hex.LinearTheme

Creates a linear gradient variant of a hex color

EvaluationContext.Colour.Hex.LinearTheme( hexColor, variant, steps, linearRange )
Parameter Type Required Description
hexColor STRING The base hex color (e.g., "#01B8AA")
variant INT64 The variant index (1-N, wraps around if exceeds steps)
steps INT64 The number of steps in the gradient (minimum = 2)
linearRange DOUBLE The range of luminance adjustment

STRING Gradient variant color in hex format

EvaluationContext.Colour.Hex.LinearTheme("#118DFF", 2, 7, 0.5) // Returns "#0061BBFF"
function 'EvaluationContext.Colour.Hex.LinearTheme' =
        (
            hexColor: STRING,
            variant: INT64,
            steps: INT64,
            linearRange: DOUBLE
        ) =>

            VAR StepSize = linearRange / ( steps - 1 )
            VAR AdjustedVariant = MOD( variant - 1, steps ) + 1
            VAR Hex =
                EvaluationContext.Colour.Hex.AdjustLuminance(
                    hexColor,
                    ( (AdjustedVariant - 1) * StepSize ) - ( linearRange / 2 )
                )

            RETURN Hex