FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
LinearGradient Struct Reference

A class representing the settings for linear-gradient color effect. More...

#include <linear_gradient.hpp>

Classes

struct  Stop
 

Public Member Functions

 LinearGradient ()
 Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGradient::Stop(). Example:
 
 LinearGradient (Color begin, Color end)
 Build a gradient with two colors.
 
 LinearGradient (float angle, Color begin, Color end)
 Build a gradient with two colors and an angle.
 
LinearGradientAngle (float angle)
 Set the angle of the gradient.
 
LinearGradientStop (Color color, float position)
 Add a color stop to the gradient.
 
LinearGradientStop (Color color)
 Add a color stop to the gradient.
 

Public Attributes

float angle = 0.f
 
std::vector< Stopstops
 

Detailed Description

A class representing the settings for linear-gradient color effect.

Example:

.Angle(45)
.Stop(Color::Red, 0.0)
.Stop(Color::Green, 0.5)
.Stop(Color::Blue, 1.0);
LinearGradient()
Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGrad...

There are also shorthand constructors:

Definition at line 30 of file linear_gradient.hpp.

Member Function Documentation

◆ Stop()

LinearGradient & Stop ( Color c,
float p )

Add a color stop to the gradient.

Parameters
cThe color of the stop.
pThe position of the stop.
Returns
The gradient.

Definition at line 225 of file src/ftxui/dom/linear_gradient.cpp.

Member Data Documentation

◆ angle

float angle = 0.f

Definition at line 31 of file linear_gradient.hpp.

◆ stops

std::vector<Stop> stops

Definition at line 36 of file linear_gradient.hpp.


The documentation for this struct was generated from the following files: