Skip to content

Def.GradientStop

Generates a gradient <stop> element for use in SVG gradients

DaxLib.SVG.Def.GradientStop( offset, color, opacity )
Name Type Required Description
offset STRING Stop position
color STRING color value (hex or named color)
opacity STRING opacity value

STRING <stop> element

DaxLib.SVG.Def.GradientStop("0%", "red", "1")
// Returns: <stop offset='0%' stop-color='red' stop-opacity='1'/>
function 'DaxLib.SVG.Def.GradientStop' = 
    (
        offset: STRING,
        color: STRING,
        opacity: STRING
    ) =>

        "<stop offset='" & offset & 
        "' stop-color='" & color & "'" &
        IF( NOT ISBLANK( opacity ), " stop-opacity='" & opacity & "'" ) &
        "/>"

Comments