Class: QgsRasterRendererUtils¶
- class qgis.core.QgsRasterRendererUtils¶
Bases:
sip.wrapper
Utility functions for raster renderers.
New in version 3.16:
Methods
Parses an exported color map file at the specified
path
and extracts the stored color rampitems
and ramp shadertype
.Exports a list of color ramp
items
and ramp shadertype
to a color map file at the specifiedpath
.- parseColorMapFile(path: str) Tuple[bool, List[QgsColorRampShader.ColorRampItem], QgsColorRampShader.Type, List[str]] ¶
Parses an exported color map file at the specified
path
and extracts the stored color rampitems
and ramp shadertype
.Returns
True
if the parsing was successful. If not, a list oferrors
will be generated.See also
- Parameters
path (str) –
- Return type
Tuple[bool, List[QgsColorRampShader.ColorRampItem], QgsColorRampShader.Type, List[str]]
- saveColorMapFile(path: str, items: Iterable[QgsColorRampShader.ColorRampItem], type: QgsColorRampShader.Type) bool ¶
Exports a list of color ramp
items
and ramp shadertype
to a color map file at the specifiedpath
.Returns
True
if the save was successful.See also
- Parameters
path (str) –
items (Iterable[QgsColorRampShader.ColorRampItem]) –
type (QgsColorRampShader.Type) –
- Return type
bool