Gamedev Framework (gf)  0.17.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::ColorRampBase< T > Struct Template Reference

A color ramp. More...

#include <gf/ColorRamp.h>

Public Member Functions

bool isEmpty () const
 Check if the color ramp is empty. More...
 
void addColorStop (T offset, const Color4< T > &color)
 Add a color stop. More...
 
Color4< TcomputeColor (T offset) const
 Compute a color from an offset. More...
 

Detailed Description

template<typename T>
struct gf::ColorRampBase< T >

A color ramp.

A color ramp (or color gradient) specifies a range of colors that depends on a position.

See also
gf::Color4f

Member Function Documentation

◆ addColorStop()

template<typename T >
void gf::ColorRampBase< T >::addColorStop ( T  offset,
const Color4< T > &  color 
)
inline

Add a color stop.

Parameters
offsetThe offset of the color
colorThe color

◆ computeColor()

template<typename T >
Color4<T> gf::ColorRampBase< T >::computeColor ( T  offset) const
inline

Compute a color from an offset.

Parameters
offsetThe offset of the wanted color
Returns
A color

◆ isEmpty()

template<typename T >
bool gf::ColorRampBase< T >::isEmpty ( ) const
inline

Check if the color ramp is empty.

Returns
True if the ramp is empty