Skip to content

Commit 1207e38

Browse files
committed
Add missing color ramp methods and conversions to sip
(cherry-picked from 56a48ed)
1 parent 98f68a4 commit 1207e38

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

python/core/symbology-ng/qgsvectorcolorrampv2.sip

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ class QgsVectorColorRampV2
66

77
%ConvertToSubClassCode
88
if (sipCpp->type() == "gradient")
9-
{
109
sipClass = sipClass_QgsVectorGradientColorRampV2;
11-
}
10+
else if (sipCpp->type() == "random")
11+
sipClass = sipClass_QgsVectorRandomColorRampV2;
12+
else if (sipCpp->type() == "randomcolors")
13+
sipClass = sipClass_QgsRandomColorsV2;
14+
else if (sipCpp->type() == "colorbrewer")
15+
sipClass = sipClass_QgsVectorColorBrewerColorRampV2;
16+
else if (sipCpp->type() == "cpt-city")
17+
sipClass = sipClass_QgsCptCityColorRampV2;
1218
else
1319
sipClass = 0;
1420
%End
@@ -110,6 +116,13 @@ class QgsVectorRandomColorRampV2 : QgsVectorColorRampV2
110116

111117
virtual QgsStringMap properties() const;
112118

119+
/** Get a list of random colors
120+
* @note added in 2.4 */
121+
static QList<QColor> randomColors( int count,
122+
int hueMax = DEFAULT_RANDOM_HUE_MAX, int hueMin = DEFAULT_RANDOM_HUE_MIN,
123+
int satMax = DEFAULT_RANDOM_SAT_MAX, int satMin = DEFAULT_RANDOM_SAT_MIN,
124+
int valMax = DEFAULT_RANDOM_VAL_MAX, int valMin = DEFAULT_RANDOM_VAL_MIN );
125+
113126
void updateColors();
114127

115128
int count() const;

0 commit comments

Comments
 (0)