QGIS API Documentation 3.41.0-Master (3291e9ff48b)
|
Totally random color ramp. More...
#include <qgscolorrampimpl.h>
Public Member Functions | |
QgsRandomColorRamp ()=default | |
QgsRandomColorRamp * | clone () const override |
Creates a clone of the color ramp. | |
QColor | color (double value) const override |
Returns the color corresponding to a specified value. | |
int | count () const override |
Returns number of defined colors, or -1 if undefined. | |
QVariantMap | properties () const override |
Returns a string map containing all the color ramp's properties. | |
virtual void | setTotalColorCount (int colorCount) |
Sets the desired total number of unique colors for the resultant ramp. | |
QString | type () const override |
Returns a string representing the color ramp type. | |
double | value (int index) const override |
Returns relative value between [0,1] of color at specified index. | |
Public Member Functions inherited from QgsColorRamp | |
virtual | ~QgsColorRamp () |
virtual void | invert () |
Inverts the ordering of the color ramp. | |
Static Public Member Functions | |
static QString | typeString () |
Returns the string identifier for QgsRandomColorRamp. | |
Static Public Member Functions inherited from QgsColorRamp | |
static QList< QPair< QString, QString > > | rampTypes () |
Returns a list of available ramp types, where the first value in each item is the QgsColorRamp::type() string and the second is a user friendly, translated name for the color ramp type. | |
Protected Attributes | |
QList< QColor > | mPrecalculatedColors |
int | mTotalColorCount = 0 |
Totally random color ramp.
Returns colors generated at random, but constrained to some hardcoded saturation and value ranges to prevent ugly color generation.
Definition at line 486 of file qgscolorrampimpl.h.
|
default |
|
overridevirtual |
Creates a clone of the color ramp.
Implements QgsColorRamp.
Definition at line 842 of file qgscolorrampimpl.cpp.
|
overridevirtual |
Returns the color corresponding to a specified value.
value | value between [0, 1] inclusive |
Implements QgsColorRamp.
Definition at line 777 of file qgscolorrampimpl.cpp.
|
overridevirtual |
Returns number of defined colors, or -1 if undefined.
Implements QgsColorRamp.
Definition at line 766 of file qgscolorrampimpl.cpp.
|
overridevirtual |
Returns a string map containing all the color ramp's properties.
Implements QgsColorRamp.
Definition at line 847 of file qgscolorrampimpl.cpp.
|
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().
colorCount | number of unique colors |
Definition at line 803 of file qgscolorrampimpl.cpp.
|
overridevirtual |
Returns a string representing the color ramp type.
Implements QgsColorRamp.
Definition at line 837 of file qgscolorrampimpl.cpp.
|
inlinestatic |
Returns the string identifier for QgsRandomColorRamp.
Definition at line 511 of file qgscolorrampimpl.h.
|
overridevirtual |
Returns relative value between [0,1] of color at specified index.
Implements QgsColorRamp.
Definition at line 771 of file qgscolorrampimpl.cpp.
|
protected |
Definition at line 522 of file qgscolorrampimpl.h.
|
protected |
Definition at line 521 of file qgscolorrampimpl.h.