Bromeon
Public Member Functions | Related Functions
thor::ColorGradient Class Reference

Class to implement color gradients. More...

List of all members.

Public Member Functions

 ColorGradient (const sf::Color &color)
 Implicit constructor from single color.
sf::Color GetColor (float interpolation) const
 Returns the color at a given progress of the gradient.

Related Functions

ColorGradientConvertible thor::CreateGradient (const sf::Color &color)
 Creates a color gradient based on a list of colors and transitions.

Detailed Description

Class to implement color gradients.

This class can represent color gradients and calculate the color at a given point. A color gradient consists of a list of N different colors and N-1 corresponding transition times (which specify how long it takes to morph one color to the other).


Constructor & Destructor Documentation

thor::ColorGradient::ColorGradient ( const sf::Color &  color)

Implicit constructor from single color.

Creates a gradient that contains only a single color.


Member Function Documentation

sf::Color thor::ColorGradient::GetColor ( float  interpolation) const

Returns the color at a given progress of the gradient.

Parameters:
interpolationNumber in [0.f, 1.f] that stands for the point at which you want to access a color from the gradient. When you pass 0 (1), the color at the very beginning (end) is returned. If the gradient consists of a single color, it is always returned (independently of interpolation).

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