Skip to main content

I have functioning geometry and a shape .manifest file with the following defaults:

        "defaults": {
            "fillColor": "#ccffee",
            "strokeColor": "#000000",
            "strokeWidth": 3,
            "rounding": 10,
            "width": 120,
            "height": 120
        }

No style formatting is applied in the .shape file (yet).  The shape behaves the way I expect with fill & line properties functioning.  I can set the gradient type and properties using the GUI and it works as intended.  I cannot find in the documentation anywhere how to define and set the ‘linear-gradient’ properties so that they are the defaults for the shape.  How is this done?

Hey Byt_Clint B thanks for reaching out!

 

We currently do not support the ability to define a default of a `linear-gradient` in the .manifest file. We do however, support the ability to define a linear-gradient as the style of individual shape(s) in the .shape files for the library. The schema definition for that is as follows 

LinearGradientFill {
type: 'linear-gradient'
angle: number|formula
colorStops: ColorStopo]
}

ColorStop {
color: string|formula
pos: number|formula
}

pos is a percentage of distance across the shape in which the gradient takes effect for the defined color

angle is the angle in degrees of how the gradient is drawn

 

Hopefully that answers your question and please let me know if you have any other questions!


Thank you!  That did get me closer to where I want to be with the shape library.  I was able to get the styling to apply in the .shape file using:

geometry: :

    {

        "type": "rect"

    }

]

style: {

    fill: {

        type: linear-gradient

        angle: 270

        colorStops:

            { color: '#ccffee', pos: 0 }

            { color: '#ffffff', pos: 0.5 }

            { color: '#00c2a8', pos: 1 }

        ]

    }

}

 

However, once that is applied the fill type/color for the shape cannot be applied/overridden in the GUI.  When using the default fillcolor in the .manifest file changing colors works as expected.  Is that just a limitation of the system at the moment, or is there a way to have the linear-gradient configuration reflected and changeable in the GUI for the custom shapes?

Took awhile to realize that the colorStop ‘pos’ percentage was between 0 and 1, not 0 and 100.


Hey byt_Clint B!

Glad to hear that got you closer to where you want to be.

Unfortunately,  settings defined in the .shape file cannot be overridden in the GUI at this time and there is no a way to define a `linear-gradient` configuration in the `.manifest` file such that it can be overridden in the GUI.

 

Hopefully that answers your questions and please let me know if you run into any other issues!


Reply