Skip to content

Commit

Permalink
Merge pull request #57361 from troopa81/cmyk_colorwidget
Browse files Browse the repository at this point in the history
[ColorWidget] Add CMYK support
  • Loading branch information
troopa81 authored May 23, 2024
2 parents 7d95eab + 1ad2b4b commit eaa0261
Show file tree
Hide file tree
Showing 11 changed files with 1,606 additions and 910 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
21 changes: 18 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

QColor::Spec colorSpec() const;
%Docstring
Returns color widget type of color, either RGB, HSV, CMYK, or Invalid if this component value is Multiple or Alpha
%End

static QColor::Spec colorSpec( QgsColorWidget::ColorComponent component );
%Docstring
Returns ``component`` type of color, either RGB, HSV, CMYK, or Invalid if ``component`` value is Multiple or Alpha
%End

static const QPixmap &transparentBackground();
%Docstring
Generates a checkboard pattern pixmap for use as a background to transparent colors
Expand All @@ -201,6 +215,7 @@ Generates a checkboard pattern pixmap for use as a background to transparent col

virtual void mouseReleaseEvent( QMouseEvent *e );


};


Expand Down
21 changes: 18 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

QColor::Spec colorSpec() const;
%Docstring
Returns color widget type of color, either RGB, HSV, CMYK, or Invalid if this component value is Multiple or Alpha
%End

static QColor::Spec colorSpec( QgsColorWidget::ColorComponent component );
%Docstring
Returns ``component`` type of color, either RGB, HSV, CMYK, or Invalid if ``component`` value is Multiple or Alpha
%End

static const QPixmap &transparentBackground();
%Docstring
Generates a checkboard pattern pixmap for use as a background to transparent colors
Expand All @@ -201,6 +215,7 @@ Generates a checkboard pattern pixmap for use as a background to transparent col

virtual void mouseReleaseEvent( QMouseEvent *e );


};


Expand Down
Loading

0 comments on commit eaa0261

Please sign in to comment.