-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from wojtryb/development
Deploy 1.4.2
- Loading branch information
Showing
10 changed files
with
172 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# SPDX-FileCopyrightText: © 2022-2023 Wojciech Trybus <[email protected]> | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
__version__ = "1.4.1" | ||
__version__ = "1.4.2" | ||
__author__ = "Wojciech Trybus" | ||
__license__ = "GPL-3.0-or-later" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# SPDX-FileCopyrightText: © 2022-2023 Wojciech Trybus <[email protected]> | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
from typing import Optional | ||
from .helpers import EnumGroup, Group | ||
|
||
|
||
|
@@ -13,85 +12,79 @@ class BlendingMode(EnumGroup): | |
""" | ||
|
||
_arithmetic = Group("Arithmetic") | ||
ADD = "add", "Addition" | ||
ADD = "add" | ||
DIVIDE = "divide" | ||
INVERSE_SUBTRACT = "inverse_subtract" | ||
MULTIPLY = "multiply" | ||
SUBTRACT = "subtract" | ||
|
||
_binary = Group("Binary") | ||
AND = "and", "AND" | ||
CONVERSE = "converse", "CONVERSE" | ||
IMPLICATION = "implication", "IMPLICATION" | ||
NAND = "nand", "NAND" | ||
NOR = "nor", "NOR" | ||
NOT_CONVERSE = "not_converse", "NOT_CONVERSE" | ||
NOT_IMPLICATION = "not_implication", "NOT_IMPLICATION" | ||
OR = "or", "OR" | ||
XNOR = "xnor", "XNOR" | ||
XOR = "xor", "XOR" | ||
AND = "and" | ||
CONVERSE = "converse" | ||
IMPLICATION = "implication" | ||
NAND = "nand" | ||
NOR = "nor" | ||
NOT_CONVERSE = "not_converse" | ||
NOT_IMPLICATION = "not_implication" | ||
OR = "or" | ||
XNOR = "xnor" | ||
XOR = "xor" | ||
|
||
_darken = Group("Darken") | ||
BURN = "burn" | ||
DARKEN = "darken" | ||
DARKER_COLOR = "darker color" | ||
EASY_BURN = "easy burn" | ||
FOG_DARKEN_IFS_ILLUSIONS = ( | ||
"fog_darken_ifs_illusions", | ||
"Fog Darken (IFS Illusions)") | ||
FOG_DARKEN_IFS_ILLUSIONS = "fog_darken_ifs_illusions" | ||
GAMMA_DARK = "gamma_dark" | ||
LINEAR_BURN = "linear_burn" | ||
SHADE_IFS_ILLUSIONS = ( | ||
"shade_ifs_illusions" | ||
"Shade (IFS Illusions)") | ||
SHADE_IFS_ILLUSIONS = "shade_ifs_illusions" | ||
|
||
_hsi = Group("HSI") | ||
COLOR_HSI = "color_hsi", "Color HSI" | ||
DEC_INTENSITY = "dec_intensity", "Decrease Intensity" | ||
DEC_SATURATION_HSI = "dec_saturation_hsi", "Decrease Saturation HSI" | ||
HUE_HSI = "hue_hsi", "Hue HSI" | ||
INC_INTENSITY = "inc_intensity", "Increase Intensity" | ||
INC_SATURATION_HSI = "inc_saturation_hsi", "Increase Saturation HSI" | ||
COLOR_HSI = "color_hsi" | ||
DEC_INTENSITY = "dec_intensity" | ||
DEC_SATURATION_HSI = "dec_saturation_hsi" | ||
HUE_HSI = "hue_hsi" | ||
INC_INTENSITY = "inc_intensity" | ||
INC_SATURATION_HSI = "inc_saturation_hsi" | ||
INTENSITY = "intensity" | ||
SATURATION_HSI = "saturation_hsi", "Saturation HSI" | ||
SATURATION_HSI = "saturation_hsi" | ||
|
||
_hsl = Group("HSL") | ||
COLOR_HSL = "color_hsl", "Color HSL" | ||
DEC_LIGHTNESS = "dec_lightness", "Decrease Lightness" | ||
DEC_SATURATION_HSL = "dec_saturation_hsl", "Decrease Saturation HSL" | ||
HUE_HSL = "hue_hsl", "Hue HSL" | ||
INC_LIGHTNESS = "inc_lightness", "Increase Lightness" | ||
INC_SATURATION_HSL = "inc_saturation_hsl", "Increase Saturation HSL" | ||
COLOR_HSL = "color_hsl" | ||
DEC_LIGHTNESS = "dec_lightness" | ||
DEC_SATURATION_HSL = "dec_saturation_hsl" | ||
HUE_HSL = "hue_hsl" | ||
INC_LIGHTNESS = "inc_lightness" | ||
INC_SATURATION_HSL = "inc_saturation_hsl" | ||
LIGHTNESS = "lightness" | ||
SATURATION_HSL = "saturation_hsl", "Saturation HSL" | ||
SATURATION_HSL = "saturation_hsl" | ||
|
||
_hsv = Group("HSV") | ||
COLOR_HSV = "color_hsv", "Color HSV" | ||
DEC_SATURATION_HSV = "dec_saturation_hsv", "Decrease Saturation HSV" | ||
DEC_VALUE = "dec_value", "Decrease Value" | ||
HUE_HSV = "hue_hsv", "Hue HSV" | ||
INC_SATURATION_HSV = "inc_saturation_hsv", "Increase Saturation HSV" | ||
INC_VALUE = "inc_value", "Increase Value" | ||
SATURATION_HSV = "saturation_hsv", "Saturation HSV" | ||
COLOR_HSV = "color_hsv" | ||
DEC_SATURATION_HSV = "dec_saturation_hsv" | ||
DEC_VALUE = "dec_value" | ||
HUE_HSV = "hue_hsv" | ||
INC_SATURATION_HSV = "inc_saturation_hsv" | ||
INC_VALUE = "inc_value" | ||
SATURATION_HSV = "saturation_hsv" | ||
VALUE = "value" | ||
|
||
_hsy = Group("HSY") | ||
COLOR = "color" | ||
DEC_LUMINOSITY = "dec_luminosity", "Decrease Luminosity" | ||
DEC_SATURATION = "dec_saturation", "Decrease Saturation" | ||
DEC_LUMINOSITY = "dec_luminosity" | ||
DEC_SATURATION = "dec_saturation" | ||
HUE = "hue" | ||
INC_LUMINOSITY = "inc_luminosity", "Increase Luminosity" | ||
INC_SATURATION = "inc_saturation", "Increase Saturation" | ||
INC_LUMINOSITY = "inc_luminosity" | ||
INC_SATURATION = "inc_saturation" | ||
LUMINIZE = "luminize" | ||
SATURATION = "saturation" | ||
|
||
_lighten = Group("Lighten") | ||
DODGE = "dodge" | ||
EASY_DODGE = "easy dodge" | ||
FLAT_LIGHT = "flat_light" | ||
FOG_LIGHTEN_IFS_ILLUSIONS = ( | ||
"fog_lighten_ifs_illusions", | ||
"Fog Lighten (IFS Illusions)") | ||
FOG_LIGHTEN_IFS_ILLUSIONS = "fog_lighten_ifs_illusions" | ||
GAMMA_ILLUMINATION = "gamma_illumination" | ||
GAMMA_LIGHT = "gamma_light" | ||
HARD_LIGHT = "hard_light" | ||
|
@@ -100,25 +93,21 @@ class BlendingMode(EnumGroup): | |
LINEAR_DODGE = "linear_dodge" | ||
LINEAR_LIGHT = "linear light" | ||
LUMINOSITY_SAI = "luminosity_sai" | ||
PNORM_A = "pnorm_a", "P-Norm A" | ||
PNORM_B = "pnorm_b", "P-Norm B" | ||
PNORM_A = "pnorm_a" | ||
PNORM_B = "pnorm_b" | ||
PIN_LIGHT = "pin_light" | ||
SCREEN = "screen" | ||
SOFT_LIGHT_IFS_ILLUSIONS = ( | ||
"soft_light_ifs_illusions", | ||
"Soft Light (IFS Illusions)") | ||
SOFT_LIGHT_PEGTOP_DELPHI = ( | ||
"soft_light_pegtop_delphi" | ||
"Soft Light (Pegtio-Delphi)") | ||
SOFT_LIGHT = "soft_light", "Soft Light (Photoshop)" | ||
SOFT_LIGHT_SVG = "soft_light_svg", "Soft Light (SVG)" | ||
SOFT_LIGHT_IFS_ILLUSIONS = "soft_light_ifs_illusions" | ||
SOFT_LIGHT_PEGTOP_DELPHI = "soft_light_pegtop_delphi" | ||
SOFT_LIGHT = "soft_light" | ||
SOFT_LIGHT_SVG = "soft_light_svg" | ||
SUPER_LIGHT = "super_light" | ||
TINT_IFS_ILLUSIONS = "tint_ifs_illusions", "Tint (IFS Illusions)" | ||
TINT_IFS_ILLUSIONS = "tint_ifs_illusions" | ||
VIVID_LIGHT = "vivid_light" | ||
|
||
_misc = Group("Misc") | ||
BUMPMAP = "bumpmap" | ||
COMBINE_NORMAL = "combine_normal", "Combine Normal Map" | ||
COMBINE_NORMAL = "combine_normal" | ||
COPY = "copy" | ||
COPY_BLUE = "copy_blue" | ||
COPY_GREEN = "copy_green" | ||
|
@@ -138,13 +127,11 @@ class BlendingMode(EnumGroup): | |
GRAIN_MERGE = "grain_merge" | ||
GREATER = "greater" | ||
HARD_MIX = "hard mix" | ||
HARD_MIX_PHOTOSHOP = "hard_mix_photoshop", "Hard Mix (Photoshop)" | ||
HARD_MIX_SOFTER_PHOTOSHOP = ( | ||
"hard_mix_softer_photoshop", | ||
"Hard Mix Softer (Photoshop)") | ||
HARD_MIX_PHOTOSHOP = "hard_mix_photoshop" | ||
HARD_MIX_SOFTER_PHOTOSHOP = "hard_mix_softer_photoshop" | ||
HARD_OVERLAY = "hard overlay" | ||
INTERPOLATION = "interpolation" | ||
INTERPOLATION_2X = "interpolation 2x", "Interpolation - 2X" | ||
INTERPOLATION_2X = "interpolation 2x" | ||
NORMAL = "normal" | ||
OVERLAY = "overlay" | ||
PARALLEL = "parallel" | ||
|
@@ -155,14 +142,10 @@ class BlendingMode(EnumGroup): | |
|
||
_modulo = Group("Modulo") | ||
DIVISIVE_MODULO = "divisive_modulo" | ||
DIVISIVE_MODULO_CONTINUOUS = ( | ||
"divisive_modulo_continuous", | ||
"Divisive Modulo - Continuous") | ||
MODULO_CONTINUOUS = "modulo_continuous", "Modulo - Continuous" | ||
DIVISIVE_MODULO_CONTINUOUS = "divisive_modulo_continuous" | ||
MODULO_CONTINUOUS = "modulo_continuous" | ||
MODULO_SHIFT = "modulo_shift" | ||
MODULO_SHIFT_CONTINUOUS = ( | ||
"modulo_shift_continuous", | ||
"Modulo Shift - Continuous") | ||
MODULO_SHIFT_CONTINUOUS = "modulo_shift_continuous" | ||
|
||
_negative = Group("Negative") | ||
ADDITIVE_SUBTRACTIVE = "additive_subtractive" | ||
|
@@ -174,24 +157,82 @@ class BlendingMode(EnumGroup): | |
|
||
_quadratic = Group("Quadratic") | ||
FREEZE = "freeze" | ||
FREEZE_REFLECT = "freeze_reflect", "Freeze-Reflect" | ||
FREEZE_REFLECT = "freeze_reflect" | ||
GLOW = "glow" | ||
GLOW_HEAT = "glow_heat", "Glow-Heat" | ||
GLOW_HEAT = "glow_heat" | ||
HEAT = "heat" | ||
HEAT_GLOW = "heat_glow", "Heat-Glow" | ||
HEAT_GLOW_FREEZE_REFLECT_HYBRID = ( | ||
"heat_glow_freeze_reflect_hybrid" | ||
"Heat-Glow & Freeze-Reflect Hybrid") | ||
HEAT_GLOW = "heat_glow" | ||
HEAT_GLOW_FREEZE_REFLECT_HYBRID = "heat_glow_freeze_reflect_hybrid" | ||
REFLECT = "reflect" | ||
REFLECT_FREEZE = "reflect_freeze", "Reflect-Freeze" | ||
|
||
def __init__(self, value: str, pretty_name: Optional[str] = None): | ||
self._value_ = value | ||
self._custom_pretty_name = pretty_name | ||
REFLECT_FREEZE = "reflect_freeze" | ||
|
||
@property | ||
def pretty_name(self) -> str: | ||
"""Format blending mode name as in Krita Blending Mode combobox.""" | ||
if self._custom_pretty_name is not None: | ||
return self._custom_pretty_name | ||
return self.name.replace("_", " ").title() | ||
"""Format tool name as in Krita Blending Mode combobox.""" | ||
if self in PRETTY_NAMES: | ||
return PRETTY_NAMES[self] | ||
return self.name.replace('_', ' ').title() | ||
|
||
|
||
PRETTY_NAMES = { | ||
BlendingMode.ADD: "Addition", | ||
BlendingMode.AND: "AND", | ||
BlendingMode.CONVERSE: "CONVERSE", | ||
BlendingMode.IMPLICATION: "IMPLICATION", | ||
BlendingMode.NAND: "NAND", | ||
BlendingMode.NOR: "NOR", | ||
BlendingMode.NOT_CONVERSE: "NOT_CONVERSE", | ||
BlendingMode.NOT_IMPLICATION: "NOT_IMPLICATION", | ||
BlendingMode.OR: "OR", | ||
BlendingMode.XNOR: "XNOR", | ||
BlendingMode.XOR: "XOR", | ||
BlendingMode.FOG_DARKEN_IFS_ILLUSIONS: "Fog Darken (IFS Illusions)", | ||
BlendingMode.SHADE_IFS_ILLUSIONS: "Shade (IFS Illusions)", | ||
BlendingMode.COLOR_HSI: "Color HSI", | ||
BlendingMode.DEC_INTENSITY: "Decrease Intensity", | ||
BlendingMode.DEC_SATURATION_HSI: "Decrease Saturation HSI", | ||
BlendingMode.HUE_HSI: "Hue HSI", | ||
BlendingMode.INC_INTENSITY: "Increase Intensity", | ||
BlendingMode.INC_SATURATION_HSI: "Increase Saturation HSI", | ||
BlendingMode.SATURATION_HSI: "Saturation HSI", | ||
BlendingMode.COLOR_HSL: "Color HSL", | ||
BlendingMode.DEC_LIGHTNESS: "Decrease Lightness", | ||
BlendingMode.DEC_SATURATION_HSL: "Decrease Saturation HSL", | ||
BlendingMode.HUE_HSL: "Hue HSL", | ||
BlendingMode.INC_LIGHTNESS: "Increase Lightness", | ||
BlendingMode.INC_SATURATION_HSL: "Increase Saturation HSL", | ||
BlendingMode.SATURATION_HSL: "Saturation HSL", | ||
BlendingMode.COLOR_HSV: "Color HSV", | ||
BlendingMode.DEC_SATURATION_HSV: "Decrease Saturation HSV", | ||
BlendingMode.DEC_VALUE: "Decrease Value", | ||
BlendingMode.HUE_HSV: "Hue HSV", | ||
BlendingMode.INC_SATURATION_HSV: "Increase Saturation HSV", | ||
BlendingMode.INC_VALUE: "Increase Value", | ||
BlendingMode.SATURATION_HSV: "Saturation HSV", | ||
BlendingMode.DEC_LUMINOSITY: "Decrease Luminosity", | ||
BlendingMode.DEC_SATURATION: "Decrease Saturation", | ||
BlendingMode.INC_LUMINOSITY: "Increase Luminosity", | ||
BlendingMode.INC_SATURATION: "Increase Saturation", | ||
BlendingMode.FOG_LIGHTEN_IFS_ILLUSIONS: "Fog Lighten (IFS Illusions)", | ||
BlendingMode.PNORM_A: "P-Norm A", | ||
BlendingMode.PNORM_B: "P-Norm B", | ||
BlendingMode.SOFT_LIGHT_IFS_ILLUSIONS: "Soft Light (IFS Illusions)", | ||
BlendingMode.SOFT_LIGHT_PEGTOP_DELPHI: "Soft Light (Pegtio-Delphi)", | ||
BlendingMode.SOFT_LIGHT: "Soft Light (Photoshop)", | ||
BlendingMode.SOFT_LIGHT_SVG: "Soft Light (SVG)", | ||
BlendingMode.TINT_IFS_ILLUSIONS: "Tint (IFS Illusions)", | ||
BlendingMode.COMBINE_NORMAL: "Combine Normal Map", | ||
BlendingMode.HARD_MIX_PHOTOSHOP: "Hard Mix (Photoshop)", | ||
BlendingMode.HARD_MIX_SOFTER_PHOTOSHOP: "Hard Mix Softer (Photoshop)", | ||
BlendingMode.INTERPOLATION_2X: "Interpolation - 2X", | ||
BlendingMode.DIVISIVE_MODULO_CONTINUOUS: "Divisive Modulo - Continuous", | ||
BlendingMode.MODULO_CONTINUOUS: "Modulo - Continuous", | ||
BlendingMode.MODULO_SHIFT_CONTINUOUS: "Modulo Shift - Continuous", | ||
BlendingMode.FREEZE_REFLECT: "Freeze-Reflect", | ||
BlendingMode.GLOW_HEAT: "Glow-Heat", | ||
BlendingMode.HEAT_GLOW: "Heat-Glow", | ||
BlendingMode.HEAT_GLOW_FREEZE_REFLECT_HYBRID: | ||
"Heat-Glow & Freeze-Reflect Hybrid", | ||
BlendingMode.REFLECT_FREEZE: "Reflect-Freeze", | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.