QGIS API Documentation  2.17.0-Master (8784312)
Public Member Functions | Protected Attributes | List of all members
QgsRandomColorsV2 Class Reference

#include <qgsvectorcolorrampv2.h>

Inheritance diagram for QgsRandomColorsV2:
Inheritance graph
[legend]

Public Member Functions

 QgsRandomColorsV2 ()
 
 ~QgsRandomColorsV2 ()
 
QgsRandomColorsV2clone () const override
 Creates a clone of the color ramp. More...
 
QColor color (double value) const override
 Returns the color corresponding to a specified value. More...
 
int count () const override
 Returns number of defined colors, or -1 if undefined. More...
 
QgsStringMap properties () const override
 Returns a string map containing all the color ramp's properties. More...
 
virtual void setTotalColorCount (const int colorCount)
 Sets the desired total number of unique colors for the resultant ramp. More...
 
QString type () const override
 Returns a string representing the color ramp type. More...
 
double value (int index) const override
 Returns relative value between [0,1] of color at specified index. More...
 
- Public Member Functions inherited from QgsVectorColorRampV2
virtual ~QgsVectorColorRampV2 ()
 

Protected Attributes

QList< QColormPrecalculatedColors
 
int mTotalColorCount
 

Detailed Description

Definition at line 285 of file qgsvectorcolorrampv2.h.

Constructor & Destructor Documentation

QgsRandomColorsV2::QgsRandomColorsV2 ( )

Definition at line 383 of file qgsvectorcolorrampv2.cpp.

QgsRandomColorsV2::~QgsRandomColorsV2 ( )

Definition at line 388 of file qgsvectorcolorrampv2.cpp.

Member Function Documentation

QgsRandomColorsV2 * QgsRandomColorsV2::clone ( ) const
overridevirtual

Creates a clone of the color ramp.

Implements QgsVectorColorRampV2.

Definition at line 461 of file qgsvectorcolorrampv2.cpp.

QColor QgsRandomColorsV2::color ( double  value) const
overridevirtual

Returns the color corresponding to a specified value.

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

Implements QgsVectorColorRampV2.

Definition at line 404 of file qgsvectorcolorrampv2.cpp.

int QgsRandomColorsV2::count ( ) const
overridevirtual

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

Implements QgsVectorColorRampV2.

Definition at line 393 of file qgsvectorcolorrampv2.cpp.

QgsStringMap QgsRandomColorsV2::properties ( ) const
overridevirtual

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

Implements QgsVectorColorRampV2.

Definition at line 466 of file qgsvectorcolorrampv2.cpp.

void QgsRandomColorsV2::setTotalColorCount ( const int  colorCount)
virtual

Sets the desired total number of unique colors for the resultant ramp.

Calling this method pregenerates a set of visually distinct colors which are returned by subsequent calls to color().

Parameters
colorCountnumber of unique colors
Note
added in QGIS 2.5

Definition at line 424 of file qgsvectorcolorrampv2.cpp.

QString QgsRandomColorsV2::type ( ) const
overridevirtual

Returns a string representing the color ramp type.

Implements QgsVectorColorRampV2.

Definition at line 456 of file qgsvectorcolorrampv2.cpp.

double QgsRandomColorsV2::value ( int  index) const
overridevirtual

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

Implements QgsVectorColorRampV2.

Definition at line 398 of file qgsvectorcolorrampv2.cpp.

Member Data Documentation

QList<QColor> QgsRandomColorsV2::mPrecalculatedColors
protected

Definition at line 314 of file qgsvectorcolorrampv2.h.

int QgsRandomColorsV2::mTotalColorCount
protected

Definition at line 313 of file qgsvectorcolorrampv2.h.


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