Class: QgsSettingsEntryColor

class qgis.core.QgsSettingsEntryColor

Bases: QgsSettingsEntryBaseTemplateQColorBase

A color settings entry.

Added in version 3.20.

QgsSettingsEntryColor(name: str, parent: QgsSettingsTreeNode, defaultValue: Union[QColor, Qt.GlobalColor, QGradient] = QColor(), description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions(), allowAlpha: bool = True) Constructor for QgsSettingsEntryColor.

Parameters:
  • name – specifies the name of the setting.

  • parent – specifies the parent in the tree of settings.

  • defaultValue – specifies the default value for the settings entry.

  • description – specifies a description for the settings entry.

  • options – specifies the options for the settings entry.

  • allowAlpha – specifies if the color can have transparency.

QgsSettingsEntryColor(key: str, pluginName: str, defaultValue: Union[QColor, Qt.GlobalColor, QGradient] = QColor(), description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions(), allowAlpha: bool = True) Constructor for QgsSettingsEntryColor. This constructor is intended to be used from plugins.

Parameters:
  • key – specifies the key of the settings.

  • pluginName – is inserted in the key after the section.

  • defaultValue – specifies the default value for the settings entry.

  • description – specifies a description for the settings entry.

  • options – specifies the options for the settings entry.

QgsSettingsEntryColor(QgsSettingsEntryColor)

Methods

allowAlpha

Returns True if transparency is allowed for the color

checkValuePrivate

Check if the value is valid

convertFromVariant

param value:

convertToVariant

Converts the value to a variant

setValuePrivate

Sets the settings value with an optional list of dynamic parts

settingsType

rtype:

Qgis.SettingsType

allowAlpha(self) bool

Returns True if transparency is allowed for the color

Added in version 3.30.

Return type:

bool

checkValuePrivate(self, value: QColor | Qt.GlobalColor | QGradient) bool

Check if the value is valid

convertFromVariant(self, value: Any) QColor
Parameters:

value (Any)

Return type:

QColor

convertToVariant(self, value: QColor | Qt.GlobalColor | QGradient) Any

Converts the value to a variant

setValuePrivate(self, value: QColor | Qt.GlobalColor | QGradient, dynamicKeyPartList: Iterable[str]) bool

Sets the settings value with an optional list of dynamic parts

settingsType(self) Qgis.SettingsType
Return type:

Qgis.SettingsType