Class PaletteView
Build from PaletteView.h
Krita 4.0.0Krita 4.2.0

The PaletteView class is a wrapper around a MVC method for handling palettes. This class shows a nice widget that can drag and drop, edit colors in a colorset and will handle adding and removing entries if you'd like it to.

Methods

PaletteView(parent: QWidget = None) addEntryWithDialog(color: ManagedColor)bool addGroupWithDialog()bool removeSelectedEntryWithDialog()bool setPalette(palette: Palette) trySelectClosestColor(color: ManagedColor)

Signals

entrySelectedBackGround(Swatch) entrySelectedForeGround(Swatch)

Member documentation

PaletteView(parent: QWidget = None)
Krita 4.0.0

Parameters

parent(no description provided)

Return

(no description provided)

addEntryWithDialog(color: ManagedColor)bool
Krita 4.0.0

This gives a simple dialog for adding colors, with options like adding name, id, and to which group the color should be added.

Parameters

color

the default color to add

Return

whether it was successful.

addGroupWithDialog()bool
Krita 4.0.0

gives a little dialog to ask for the desired groupname.

Return

whether this was successful.

Krita 4.2.0

fires when a swatch is selected with rightclick.

Parameters

entry

(no description provided)

Krita 4.2.0

fires when a swatch is selected with leftclick.

Parameters

entry

(no description provided)

Krita 4.0.0

removes the selected entry. If it is a group, it pop up a dialog asking whether the colors should also be removed.

Return

whether this was successful

setPalette(palette: Palette)
Krita 4.0.0

Set a new palette.

Parameters

palette

(no description provided)

Krita 4.0.0

tries to select the closest color to the one given. It does not force a change on the active color.

Parameters

color

the color to compare to.