View Source Scenic.Primitive.Style.Paint.LinearGradient (Scenic v0.11.2)

Fill a primitive with a linear gradient between two colors

data-format

Data Format

{:linear, {start_x, start_y, end_x, end_y, color_start, color_end}}

This example fills with a smooth linear gradient that goes from blue in the upper left corner of the rect to yellow in the lower right corner.

Graph.build()
  |> rect( {100, 50}, fill: {:linear, {0, 0, 100, 50, :blue, :yellow}} )