Skip to content

Commit

Permalink
feat(ColorWidget) : Add CMYK support
Browse files Browse the repository at this point in the history
  • Loading branch information
troopa81 committed May 13, 2024
1 parent eee787f commit 8e8179a
Show file tree
Hide file tree
Showing 11 changed files with 1,361 additions and 812 deletions.
4 changes: 4 additions & 0 deletions python/PyQt6/gui/auto_additions/qgscolorwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
QgsColorWidget.Saturation = QgsColorWidget.ColorComponent.Saturation
QgsColorWidget.Value = QgsColorWidget.ColorComponent.Value
QgsColorWidget.Alpha = QgsColorWidget.ColorComponent.Alpha
QgsColorWidget.Cyan = QgsColorWidget.ColorComponent.Cyan
QgsColorWidget.Magenta = QgsColorWidget.ColorComponent.Magenta
QgsColorWidget.Yellow = QgsColorWidget.ColorComponent.Yellow
QgsColorWidget.Black = QgsColorWidget.ColorComponent.Black
QgsColorRampWidget.Horizontal = QgsColorRampWidget.Orientation.Horizontal
QgsColorRampWidget.Vertical = QgsColorRampWidget.Orientation.Vertical
QgsColorTextWidget.HexRgb = QgsColorTextWidget.ColorTextFormat.HexRgb
Expand Down
20 changes: 17 additions & 3 deletions python/PyQt6/gui/auto_generated/qgscolorwidgets.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ set to a color with an ambiguous hue (e.g., black or white shades).
Hue,
Saturation,
Value,
Alpha
Alpha,
Cyan,
Magenta,
Yellow,
Black
};

QgsColorWidget( QWidget *parent /TransferThis/ = 0, ColorComponent component = Multiple );
Expand Down Expand Up @@ -145,7 +149,7 @@ Returns the range of valid values for the color widget's component
:return: maximum value allowed for color component, or -1 if widget has multiple components
%End

int componentRange( ColorComponent component ) const;
static int componentRange( ColorComponent component );
%Docstring
Returns the range of valid values a color component

Expand All @@ -172,7 +176,7 @@ as QColor returns a hue of -1 if the color's hue is ambiguous (e.g., if the satu
:return: explicitly set hue for widget
%End

void alterColor( QColor &color, QgsColorWidget::ColorComponent component, int newValue ) const;
static void alterColor( QColor &color, QgsColorWidget::ColorComponent component, int newValue );
%Docstring
Alters a color by modifying the value of a specific color component

Expand All @@ -182,6 +186,16 @@ Alters a color by modifying the value of a specific color component
valid range for the color component.
%End

bool isCmyk() const;
%Docstring
Returns true if the color widget component is either Cyan, Magenta, Yellow or Black
%End

static bool isCmyk( QgsColorWidget::ColorComponent component );
%Docstring
Returns true if ``component`` is either Cyan, Magenta, Yellow or Black
%End

static const QPixmap &transparentBackground();
%Docstring
Generates a checkboard pattern pixmap for use as a background to transparent colors
Expand Down
20 changes: 17 additions & 3 deletions python/gui/auto_generated/qgscolorwidgets.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ set to a color with an ambiguous hue (e.g., black or white shades).
Hue,
Saturation,
Value,
Alpha
Alpha,
Cyan,
Magenta,
Yellow,
Black
};

QgsColorWidget( QWidget *parent /TransferThis/ = 0, ColorComponent component = Multiple );
Expand Down Expand Up @@ -145,7 +149,7 @@ Returns the range of valid values for the color widget's component
:return: maximum value allowed for color component, or -1 if widget has multiple components
%End

int componentRange( ColorComponent component ) const;
static int componentRange( ColorComponent component );
%Docstring
Returns the range of valid values a color component

Expand All @@ -172,7 +176,7 @@ as QColor returns a hue of -1 if the color's hue is ambiguous (e.g., if the satu
:return: explicitly set hue for widget
%End

void alterColor( QColor &color, QgsColorWidget::ColorComponent component, int newValue ) const;
static void alterColor( QColor &color, QgsColorWidget::ColorComponent component, int newValue );
%Docstring
Alters a color by modifying the value of a specific color component

Expand All @@ -182,6 +186,16 @@ Alters a color by modifying the value of a specific color component
valid range for the color component.
%End

bool isCmyk() const;
%Docstring
Returns true if the color widget component is either Cyan, Magenta, Yellow or Black
%End

static bool isCmyk( QgsColorWidget::ColorComponent component );
%Docstring
Returns true if ``component`` is either Cyan, Magenta, Yellow or Black
%End

static const QPixmap &transparentBackground();
%Docstring
Generates a checkboard pattern pixmap for use as a background to transparent colors
Expand Down
Loading

0 comments on commit 8e8179a

Please sign in to comment.