Gamedev Framework (gf)  0.3.0
A C++11 framework for 2D games
Public Member Functions | List of all members
gf::ColorRamp Struct Reference

A color ramp. More...

#include <gf/ColorRamp.h>

Public Member Functions

 ColorRamp ()
 Default constructor. More...
 
bool isEmpty () const
 Check if the color ramp is empty. More...
 
void addColorStop (float offset, const Color4f &color)
 Add a color stop. More...
 
Color4f computeColor (float offset) const
 Compute a color from an offset. More...
 

Detailed Description

A color ramp.

See also
gf::Color4f

Constructor & Destructor Documentation

gf::ColorRamp::ColorRamp ( )

Default constructor.

The color ramp is empty.

Member Function Documentation

void gf::ColorRamp::addColorStop ( float  offset,
const Color4f color 
)

Add a color stop.

Parameters
offsetThe offset of the color
colorThe color
Color4f gf::ColorRamp::computeColor ( float  offset) const

Compute a color from an offset.

Parameters
offsetThe offset of the wanted color
Returns
A color
bool gf::ColorRamp::isEmpty ( ) const

Check if the color ramp is empty.

Returns
True if the ramp is empty