Background Gradient

I’m attempting to create a background-gradient.

<Panel Margin="0" Padding="5,5" Color="#E3234D">
</Panel>

How would I go ahead and get the background-color of the Panel to be a gradient instead of a solid? For example from red -> blue.

Hi Matt,

for that you would use LinearGradient.

Hi Uldis!

Thats what I’ve understood also. Being new to Fusetools, I’m trying to understand how LinearGradient works.

Would I create a LinearGradient class inside my Panel? Would I leave the Panel’s color attribute empty?

Thanks!

Yes Matt, that’s exactly what you would do. Similar to what the example shows on the docs page:

<Panel>
    <LinearGradient StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0" Color="Red" />
        <GradientStop Offset="1" Color="Blue" />
    </LinearGradient>
</Panel>

Got it! Thank you so much! :slight_smile: