QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Member Functions | List of all members
QgsColorRamp Class Referenceabstract

Abstract base class for color ramps. More...

#include <qgscolorramp.h>

Inheritance diagram for QgsColorRamp:
Inheritance graph
[legend]

Public Member Functions

virtual ~QgsColorRamp ()=default
 
virtual QgsColorRampclone () const =0
 Creates a clone of the color ramp. More...
 
virtual QColor color (double value) const =0
 Returns the color corresponding to a specified value. More...
 
virtual int count () const =0
 Returns number of defined colors, or -1 if undefined. More...
 
virtual void invert ()
 Inverts the ordering of the color ramp. More...
 
virtual QgsStringMap properties () const =0
 Returns a string map containing all the color ramp's properties. More...
 
virtual QString type () const =0
 Returns a string representing the color ramp type. More...
 
virtual double value (int index) const =0
 Returns relative value between [0,1] of color at specified index. More...
 

Detailed Description

Abstract base class for color ramps.

Since
QGIS 3.0

Definition at line 31 of file qgscolorramp.h.

Constructor & Destructor Documentation

virtual QgsColorRamp::~QgsColorRamp ( )
virtualdefault

Member Function Documentation

virtual QgsColorRamp* QgsColorRamp::clone ( ) const
pure virtual
virtual QColor QgsColorRamp::color ( double  value) const
pure virtual

Returns the color corresponding to a specified value.

Parameters
valuevalue between [0, 1] inclusive
Returns
color for value

Implemented in QgsColorBrewerColorRamp, QgsPresetSchemeColorRamp, QgsRandomColorRamp, QgsLimitedRandomColorRamp, and QgsGradientColorRamp.

virtual int QgsColorRamp::count ( ) const
pure virtual

Returns number of defined colors, or -1 if undefined.

Implemented in QgsColorBrewerColorRamp, QgsPresetSchemeColorRamp, QgsRandomColorRamp, QgsLimitedRandomColorRamp, and QgsGradientColorRamp.

virtual void QgsColorRamp::invert ( )
inlinevirtual

Inverts the ordering of the color ramp.

Reimplemented in QgsCptCityColorRamp, QgsColorBrewerColorRamp, QgsPresetSchemeColorRamp, and QgsGradientColorRamp.

Definition at line 82 of file qgscolorramp.h.

virtual QgsStringMap QgsColorRamp::properties ( ) const
pure virtual

Returns a string map containing all the color ramp's properties.

Implemented in QgsCptCityColorRamp, QgsColorBrewerColorRamp, QgsPresetSchemeColorRamp, QgsRandomColorRamp, QgsLimitedRandomColorRamp, and QgsGradientColorRamp.

virtual QString QgsColorRamp::type ( ) const
pure virtual
virtual double QgsColorRamp::value ( int  index) const
pure virtual

Returns relative value between [0,1] of color at specified index.

Implemented in QgsColorBrewerColorRamp, QgsPresetSchemeColorRamp, QgsRandomColorRamp, QgsLimitedRandomColorRamp, and QgsGradientColorRamp.


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