liveBook · Manning

Color stop

As explained in .NET MAUI in Action

A gradient stop is a brush element that associates a color with a fractional position along a gradient axis.

A color stop associates a color with a fractional position along a gradient axis. Its Color property supplies the color, while Offset places it from 0 at the start to 1 at the end. section 10.1.1

Two-stop page background

A LinearGradientBrush can use two color stops: PrimaryBackground at Offset 0 and SecondaryBackground at Offset 1. With a StartPoint of 0,1 and EndPoint of 1,0, the background gradient runs from bottom left to top right. section 10.1.1

Listing 10.2 The background setter for the Page style
<Setter Property="Background">
    <Setter.Value>
        <LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
            <GradientStop Color="{StaticResource
 PrimaryBackground}” Offset=”0”/>
            <GradientStop Color=”{StaticResource
 SecondaryBackground}" Offset="1"/>
        </LinearGradientBrush>
    </Setter.Value>
</Setter>

Inspect the XAML setter that places two resource colors at opposite ends of a page background gradient. section 10.1.1

How .NET MAUI in Action covers it

How deep it goes
Explains Color and Offset, including the 0-to-1 range, and demonstrates two stops without detailing gradient interpolation.
Examples
Uses PrimaryBackground and SecondaryBackground at offsets 0 and 1 in a styled page background.
What it assumes
Assumes a LinearGradientBrush and its axis are understood while introducing fractional view coordinates and stop offsets.
What you can do after
Apply it via .NET MAUI XAML to place resource-defined colors along a gradient axis.
How it connects
Connects gradient stops with LinearGradientBrush, gradient axis, StartPoint, EndPoint, styles, and resource dictionaries.

Also explained in

Compare how 3 books explain color stop →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.