Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Util::Gradient Class Reference

Color gradient in HSV space. More...

#include <gradient.h>

Collaboration diagram for Updraft::Util::Gradient:

List of all members.

Public Member Functions

 Gradient (const QColor &c1, const QColor &c2, bool reverseHue=false)
 Initialize the gradient with end colors.
 Gradient ()
 Gradients made with this constructor are completely black.
QColor get (qreal t) const
 Return the color at given position.

Protected Attributes

LinearFunc hue
LinearFunc sat
LinearFunc val
LinearFunc alpha

Detailed Description

Color gradient in HSV space.


Constructor & Destructor Documentation

Updraft::Util::Gradient::Gradient ( const QColor &  c1,
const QColor &  c2,
bool  reverseHue = false 
)

Initialize the gradient with end colors.

Parameters:
c1Color to start at.
c2Color to stop at.
reverseHueIf this is true, then hue is interpolated in the reverse direction -- that means it takes the longer path. Example: Gradient(Qt::red, Qt::green, false) only goes through yellow, while Gradient(Qt::red, Qt::green, true) becomes violet, blue and cyan.

Gradients made with this constructor are completely black.


Member Function Documentation

QColor Updraft::Util::Gradient::get ( qreal  t) const

Return the color at given position.

Parameters:
tposition in the gradient, t >= 0, t <= 1

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines