Skip to content

Commit

Permalink
Add missing color ramp methods and conversions to sip
Browse files Browse the repository at this point in the history
(cherry-picked from 56a48ed)
  • Loading branch information
nyalldawson committed Aug 5, 2015
1 parent 98f68a4 commit 1207e38
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions python/core/symbology-ng/qgsvectorcolorrampv2.sip
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ class QgsVectorColorRampV2

%ConvertToSubClassCode
if (sipCpp->type() == "gradient")
{
sipClass = sipClass_QgsVectorGradientColorRampV2;
}
else if (sipCpp->type() == "random")
sipClass = sipClass_QgsVectorRandomColorRampV2;
else if (sipCpp->type() == "randomcolors")
sipClass = sipClass_QgsRandomColorsV2;
else if (sipCpp->type() == "colorbrewer")
sipClass = sipClass_QgsVectorColorBrewerColorRampV2;
else if (sipCpp->type() == "cpt-city")
sipClass = sipClass_QgsCptCityColorRampV2;
else
sipClass = 0;
%End
Expand Down Expand Up @@ -110,6 +116,13 @@ class QgsVectorRandomColorRampV2 : QgsVectorColorRampV2

virtual QgsStringMap properties() const;

/** Get a list of random colors
* @note added in 2.4 */
static QList<QColor> randomColors( int count,
int hueMax = DEFAULT_RANDOM_HUE_MAX, int hueMin = DEFAULT_RANDOM_HUE_MIN,
int satMax = DEFAULT_RANDOM_SAT_MAX, int satMin = DEFAULT_RANDOM_SAT_MIN,
int valMax = DEFAULT_RANDOM_VAL_MAX, int valMin = DEFAULT_RANDOM_VAL_MIN );

void updateColors();

int count() const;
Expand Down

0 comments on commit 1207e38

Please sign in to comment.