Class: QgsCptCityColorRamp

A color ramp from the CPT City collection.

Class Hierarchy

Inheritance diagram of qgis.core.QgsCptCityColorRamp

Base classes

QgsGradientColorRamp

Gradient color ramp, which smoothly interpolates between two colors and also supports optional extra color stops.

QgsColorRamp

Abstract base class for color ramps.

Methods

cloneGradientRamp

copy

copyingFileName

copyingInfo

descFileName

fileLoaded

fileName

hasMultiStops

loadFile

loadPalette

schemeName

setName

setSchemeName

setVariantList

setVariantName

variantList

variantName

Static Methods

create

Creates the symbol layer

typeString

Returns the string identifier for QgsCptCityColorRamp.

class qgis.core.QgsCptCityColorRamp[source]

Bases: QgsGradientColorRamp

__init__(schemeName: str | None = '', variantName: str | None = '', inverted: bool = False, doLoadFile: bool = True)

Constructor for QgsCptCityColorRamp

Parameters:
  • schemeName (Optional[str] = '') – cpt-city scheme name

  • variantName (Optional[str] = '') – cpt-city variant name

  • inverted (bool = False) – invert ramp ordering

  • doLoadFile (bool = True) – load cpt-city ramp from file

__init__(schemeName: str | None, variantList: Iterable[str | None], variantName: str | None = '', inverted: bool = False, doLoadFile: bool = True)

Constructor for QgsCptCityColorRamp

Parameters:
  • schemeName (Optional[str]) – cpt-city scheme name

  • variantList (Iterable[Optional[str]]) – cpt-city variant list

  • variantName (Optional[str] = '') – cpt-city variant name

  • inverted (bool = False) – invert ramp ordering

  • doLoadFile (bool = True) – load cpt-city ramp from file

__init__(a0: QgsCptCityColorRamp)
Parameters:

a0 (QgsCptCityColorRamp)

cloneGradientRamp(self) QgsGradientColorRamp | None[source]
Return type:

Optional[QgsGradientColorRamp]

copy(self, other: QgsCptCityColorRamp | None)[source]
Parameters:

other (Optional[QgsCptCityColorRamp])

copyingFileName(self) str[source]
Return type:

str

copyingInfo(self) Dict[str, str][source]
Return type:

Dict[str, str]

static create(properties: Dict[str, Any] = {}) QgsColorRamp | None[source]

Creates the symbol layer

Parameters:

properties (Dict[str, Any] = {})

Return type:

Optional[QgsColorRamp]

descFileName(self) str[source]
Return type:

str

fileLoaded(self) bool[source]
Return type:

bool

fileName(self) str[source]
Return type:

str

hasMultiStops(self) bool[source]
Return type:

bool

loadFile(self) bool[source]
Return type:

bool

loadPalette(self)[source]
schemeName(self) str[source]
Return type:

str

setName(self, schemeName: str | None, variantName: str | None = '', variantList: Iterable[str | None] = [])[source]
Parameters:
  • schemeName (Optional[str])

  • variantName (Optional[str] = '')

  • variantList (Iterable[Optional[str]] = [])

setSchemeName(self, schemeName: str | None)[source]
Parameters:

schemeName (Optional[str])

setVariantList(self, variantList: Iterable[str | None])[source]
Parameters:

variantList (Iterable[Optional[str]])

setVariantName(self, variantName: str | None)[source]
Parameters:

variantName (Optional[str])

static typeString() str[source]

Returns the string identifier for QgsCptCityColorRamp.

Added in version 3.16.

Return type:

str

variantList(self) List[str][source]
Return type:

List[str]

variantName(self) str[source]
Return type:

str