OpenStructure
|
#include <gradient.hh>
Data Structures | |
struct | Stop |
Public Types | |
typedef std::vector< Stop > | StopList |
Public Member Functions | |
Gradient () | |
Gradient (const String &name) | |
Color | GetColorAt (float t) const |
void | SetColorAt (float t, const Color &color) |
void | GradientToInfo (info::InfoGroup &group) const |
StopList | GetStops () const |
Static Public Member Functions | |
static gfx::Gradient | GradientFromInfo (const info::InfoGroup &group) |
color gradient
Gradients map a scalar value in the range of 0 to 1 to a color. The gradient consists of zero or more color stops. These stop points define the output of GetColorAt(). New stops can be added with SetColorAt().
Definition at line 43 of file gradient.hh.
Definition at line 67 of file gradient.hh.
Gradient | ( | ) |
In python, the gradient can also be initialize with a dictionary, mapping stops to either float triplets or gfx.Color objects
Color GetColorAt | ( | float | t | ) | const |
get color
StopList GetStops | ( | ) | const |
get list of color stops
|
static |
create gradient from info
void GradientToInfo | ( | info::InfoGroup & | group | ) | const |
convert gradient to info
void SetColorAt | ( | float | t, |
const Color & | color | ||
) |
set color
t | is the position where the new stop should be inserted |
color | is the color of the stop |