Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ColorWidget] Add CMYK support #57361

Merged
merged 12 commits into from
May 23, 2024
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
Loading