OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Data Structures | Public Types | Public Member Functions | Static Public Member Functions
Gradient Class Reference

#include <gradient.hh>

Data Structures

struct  Stop

Public Types

typedef std::vector< StopStopList

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)

Detailed Description

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().

See also:
Gradient Example

Definition at line 43 of file gradient.hh.


Member Typedef Documentation

typedef std::vector<Stop> StopList

Definition at line 67 of file gradient.hh.


Constructor & Destructor Documentation

Gradient ( )

In python, the gradient can also be initialize with a dictionary, mapping stops to either float triplets or gfx.Color objects

Gradient ( const String name)

initialize with a pre-define gradient name


Member Function Documentation

Color GetColorAt ( float  t) const

get color

StopList GetStops ( ) const

get list of color stops

static gfx::Gradient GradientFromInfo ( const info::InfoGroup group)
static

create gradient from info

void GradientToInfo ( info::InfoGroup group) const

convert gradient to info

void SetColorAt ( float  t,
const Color color 
)

set color

Parameters:
tis the position where the new stop should be inserted
coloris the color of the stop

The documentation for this class was generated from the following file: