Gamedev Framework (gf)  0.9.0
A C++14 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

◆ ColorRamp()

gf::ColorRamp::ColorRamp ( )

Default constructor.

The color ramp is empty.

Member Function Documentation

◆ addColorStop()

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

Add a color stop.

Parameters
offsetThe offset of the color
colorThe color

◆ computeColor()

Color4f gf::ColorRamp::computeColor ( float  offset) const

Compute a color from an offset.

Parameters
offsetThe offset of the wanted color
Returns
A color

◆ isEmpty()

bool gf::ColorRamp::isEmpty ( ) const

Check if the color ramp is empty.

Returns
True if the ramp is empty