diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2022-04-10 10:10:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-10 10:10:50 +0200 |
| commit | c575aeda96d389de29389c9e6e46395e1b938244 (patch) | |
| tree | e235d604bcbd7262c79a02dc255c667eb7ebe56e /lib/extensions/generate_palette.py | |
| parent | 3780791c26cb5a61855c14685837f5513958a1b1 (diff) | |
palette to text (#1619)
Diffstat (limited to 'lib/extensions/generate_palette.py')
| -rw-r--r-- | lib/extensions/generate_palette.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/extensions/generate_palette.py b/lib/extensions/generate_palette.py index 4255cfba..280be90f 100644 --- a/lib/extensions/generate_palette.py +++ b/lib/extensions/generate_palette.py @@ -4,7 +4,6 @@ # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. import os -import sys import inkex @@ -30,29 +29,29 @@ class GeneratePalette(InkstitchExtension): if not brand: inkex.errormsg(_("Please specify a name for your color palette.")) - sys.exit() + return if path: if not os.path.isdir(path): inkex.errormsg(_("Unkown directory path.")) - sys.exit() + return else: path = os.path.join(guess_inkscape_config_path(), 'palettes') if not os.path.isdir(path): inkex.errormsg(_("Ink/Stitch cannot find your palette folder automatically. Please enter the path manually.")) - sys.exit() + return - elements = self.svg.selected.rendering_order() + elements = self.svg.selection.rendering_order() if not elements: inkex.errormsg(_("No element selected.\n\nPlease select at least one text element with a fill color.")) - sys.exit() + return colors = self._get_color_from_elements(elements) if not colors: inkex.errormsg(_("We couldn't find any fill colors on your text elements. Please read the instructions on our website.")) - sys.exit() + return colors = ['GIMP Palette', color_palette_name, '\nColumns: 4', '\n# RGB Value\t Color Name Number'] + colors |
