vrdLinearGradient

class vrdLinearGradient

(Inherits vrdSceneObject)

Defines a linear gradient and evaluates it.

The gradient colors are defined and evaluated in linear color space. Interpolation between two neighboring stops is done linearly as long as the mid color position is 0.5. For other values, the interpolation will be weighted with an exponential term.

Functions

vrdLinearGradient.evaluateAt(position)

Evaluates the gradient.

Parameters:position (qreal) – The position to evaluate at.
Returns:The color of the gradient at given position.
Return type:QColor
vrdLinearGradient.getImage(size, format=QImage.Format_RGB32, convertToSRgb=True)

Generates an image of the gradient.

Parameters:
  • size (QSize) – The size of the image.
  • format (QImage.Format) – The format of the image.
  • convertToSRgb (bool) – Specifies if the result will be converted to sRgb.
Returns:

An image containing the rendered gradient.

Return type:

QImage

vrdLinearGradient.getLookupTable(tableSize, convertToSRgb)

Generates a lookup table.

Parameters:
  • tableSize (integer) – The size of the lookup table.
  • convertToSRgb (bool) – Specifies if the result will be converted to sRgb.
Returns:

A lookup table of the gradients colors over it entire range.

Return type:

List[QColor]

vrdLinearGradient.getStops()

Gets the stops.

Returns:The stops that define the gradient.
Return type:List[vrdLinearGradientStop]
vrdLinearGradient.setStops(stops)

Sets the stops.

Parameters:stops (List[vrdLinearGradientStop]) – The stops that define the gradient.