LinearGradientFilling

LinearGradientFilling[{col1,col2,,coln}]

is a two-dimensional graphics directive specifying that faces of polygons and other filled graphics objects are to be drawn using a progressive transition between colors coli along a straight horizontal line.

LinearGradientFilling[{pos1,pos2,,posn}{col1,col2,,coln}]

uses the colors coli at the scaled positions posi.

LinearGradientFilling[{pos1,pos2,,posn}{col1,col2,,coln},dir]

draws along the straight line with a direction dir.

LinearGradientFilling[{pos1,,posn}{col1,,coln},dir,padding]

uses the specified padding when drawing beyond the boundary positions pos1 and posn.

Details

Examples

open allclose all

Basic Examples  (3)

Apply a linear gradient filling to a rectangle:

Fill from a curve to the axis:

A linear gradient filling of the US map:

Scope  (14)

Basic Uses  (6)

Apply gradient filling to graphics primitives:

Apply gradient filling to a plot:

Apply gradient filling to a chart:

Style a geometric region:

Show a schematic outline map:

Summary box:

Specifications  (8)

LinearGradientFilling with no arguments draws a progressive transition from Black to White:

Use a custom color sequence:

Specify the scaled position of each color:

Scaled positions are taken to be relative to the width of the graphic objects:

Specify color positions by fractions of the whole image:

Use predefined color schemes from ColorData:

Draw a linear gradient at an angle θ in radians:

Specify the angle in degrees:

Use predefined directions:

Specify what padding when drawing beyond the bounding positions:

Applications  (13)

Basic Applications  (3)

Show gradient colors and their positions:

Progressive transition between colors at 0 and 1:

Colors at midpoints:

Colors at random positions:

Show gradient directions:

Different angles:

Show gradient colors and padding:

Fixed padding:

Periodic padding:

Reflected padding:

Gradient Colors  (3)

Collection of gradient colors in ColorData:

Show gradients:

Collection of gradient colors in the Wolfram Data Repository:

Show gradients:

Collection of hue colors in the Wolfram Data Repository:

Show gradients:

Graphics  (3)

Apply gradient fillings to graphics primitives:

Apply gradient fillings to Text:

Add a gradient background to graphics objects:

A graphics object with a gradient background:

A graph:

A bar chart:

Visualization  (4)

Plot with a background gradient:

Fill between two curves:

Style bar charts:

Style a time series plot:

Properties & Relations  (5)

LinearGradientFilling uses the color space of the specified colors:

The linear gradient with colors in HSB color space:

Different colors can be given at a single position to generate hard stops:

LinearGradientImage returns an image with linear blend of colors:

Use Blend to generate an array of blended colors:

VertexColors interpolate between colors:

Possible Issues  (2)

When colors are specified with the same color space, that space is used for interpolation:

When colors are specified using different color spaces, interpolation happens in the color space of the first color:

Grayscale color space is interpreted as RGB color space:

Color directives are preceded by LinearGradientFilling:

Wolfram Research (2020), LinearGradientFilling, Wolfram Language function, https://reference.wolfram.com/language/ref/LinearGradientFilling.html.

Text

Wolfram Research (2020), LinearGradientFilling, Wolfram Language function, https://reference.wolfram.com/language/ref/LinearGradientFilling.html.

CMS

Wolfram Language. 2020. "LinearGradientFilling." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LinearGradientFilling.html.

APA

Wolfram Language. (2020). LinearGradientFilling. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LinearGradientFilling.html

BibTeX

@misc{reference.wolfram_2024_lineargradientfilling, author="Wolfram Research", title="{LinearGradientFilling}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/LinearGradientFilling.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_lineargradientfilling, organization={Wolfram Research}, title={LinearGradientFilling}, year={2020}, url={https://reference.wolfram.com/language/ref/LinearGradientFilling.html}, note=[Accessed: 21-November-2024 ]}