Swap Palette Colors - Extension

Post questions on how to use or achieve an effect in Inkscape.
User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Swap Palette Colors - Extension

Postby ragstian » Mon May 20, 2013 7:39 am

Hi.

Here are my "Swap Palette Extension" version 0.11

Save the zip files to temp directory.
Unpack the "Swap_palettes.zip" file and place in user extension directory - mine (win7) is "C:\Users\Ragnar\AppData\Roaming\inkscape\extensions".
Unpack the "Swap_Col_Test_Palettes.zip" to user palette directory - mine (win7) is: "C:\Users\Ragnar\AppData\Roaming\inkscape\palettes".

Test on the attached SVG file;
Select the third row of color-bars and text - run the extension from Extensions - Swap Palettes.
Note how the first text color and rectangle fill color is not changed as the colors used on them is not in the two palettes.
The rectangle border is changed as it is part of the palette.

For this extension to work the number of colors in the two palette files has to be the same.
( If they differ they can be edited in your favorite text editor. )

Edit: Swap_palettes_extension.zip - Swap_Col_Test_Palettes - reverse_palette_test.svg - Files obsolete - see later posts for new version.

Have fun
RGDS
Ragnar
Last edited by ragstian on Wed May 22, 2013 6:11 am, edited 3 times in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Swap Palette Colors - Extension

Postby Lazur » Mon May 20, 2013 8:03 am

Looks interesting!

IOError: [Errno 2] No such file or directory: 'C:\\Graphics\\Inkscape\\share\\palettes\\svg.gpl'


For win users I belive that should be located in program files, not in graphics folder.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Mon May 20, 2013 8:10 am

Hi Lazur URH.

I like to keep all my "Dynamic Applications" in a directory away from the "Program Folder" directory as it makes my life much simpler.

You can change the default directory in the Swap_Palettes.INX file to your liking.
Just has to be done once.
The code is still under "heavy constructions" and any feedback like yours are very welcome!
Will change the code to be more "Pythonic" but the main task was to get it working - sort of - first.


RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Swap Palette Colors - Extension

Postby Lazur » Mon May 20, 2013 8:27 am

IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Inkscape\\share\\palettes\\svg_reversed.gpl'


By default the new palette was set to svg reversed, but you attached different palettes.

With avr_vga and avr_vga_sorted it is working.

But how?
How should it work? It could be run on the same third line, producing three different colouring order each time. Is that ok?

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Mon May 20, 2013 10:40 am

Hi


Let me try to explain by using an example - first a listing of the first six colors in the two palette files used;

Palette file 1;

Code: Select all

GIMP Palette
Name: SwapTest_1
Generated by: Python Program - Ragnar
#
128   0   0  Maroon (#800000)
255   0   0  Red (#FF0000)
128 128   0  Olive (#808000)
255 255   0  Yellow (#FFFF00)
  0 128   0  Green (#008000)
  0 255   0  Lime (#00FF00)


Palette file 2;

Code: Select all

GIMP Palette
Name: SwapTest_2
Generated by: Python Program - Ragnar
#
  0 128 128  Teal (#008080)
  0 255 255  Aqua (#00FFFF)
  0   0 128  Navy (#000080)
  0   0 255  Blue (#0000FF)
128   0 128  Purple (#800080)
255   0 255  Fuchsia (#FF00FF)


Note that the header in these files is four lines - varies in different GIMP Palette files.
When running the extension - all selected elements with the Maroon color - line 5 in Swaptest_1.gpl will get the color from line 5 of theSwaptest_2.gpl - Teal
All elements with Red (Line 6 in SwapTest_1.gpl file) will get Aqua (Line 6 in SwapTest_2.gpl file).
All elements with Olive (Line 7 in SwapTest_1.gpl file) will get Navy (Line 7 in SwapTest_2.gpl file).
All elements with Yellow (Line 8 in SwapTest_1.gpl file) will get Blue (Line 8 in SwapTest_2.gpl file).
All elements with Green (Line 9 in SwapTest_1.gpl file) will get Purple (Line 9 in SwapTest_2.gpl file).

By using the two palettes in example above: SVG Image\
Note that the text and textboxes are not affected as I used colors not in the palette for those - making them "invisible" to the extension.
If some "clever" palette files is created a winter scene can be changed to autumn scene by using this extension, colors can be made grayscale - etc - the sky is (not) the limit!

Thanks for asking - I found some Palette files which are not indexed properly by the extension - stay tuned for updates. It is very difficult to cover all scenarios when testing - even for a simple extension like this - ( and my two braincells! :D )
Extension created for the original poster in this post; http://www.inkscapeforum.com/viewtopic.php?f=5&t=14073

RGDS
Ragnar
Last edited by ragstian on Mon May 20, 2013 11:15 am, edited 2 times in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Swap Palette Colors - Extension

Postby Lazur » Mon May 20, 2013 11:01 am

I was thinking of actual useage.
Like, those two palettes were made of the same colours, but in a mixed order.
Thus, when once applied, you could use it again.
The basic idea from that previous post it came was to make different, pre-defined colour schemes for the same drawing.
So, once a palette is applied right, I wouldn't expect it to change any more when the same "swap to this palette" would be applied.

The main idea is a bit over me because I would expect from such extension to apply to all the colours on the drawing, even which are not part of the new palette.

For an example.
You have a complete drawing, with many elements in it that you don't want to change fills separately.
But, you would like to see a copy of it, which is made up from those crayola colours.

Have no clue how to implement that.
With solid fills, it would be easier to get the nearest colours from the palette I guess,
but recreating gradients is much harder, and filters maybe impossible.
Maybe with colour transformation matrix extensions based on custom palettes?

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Mon May 20, 2013 11:35 am

Hi Lazur URH.

In the example in my previous post the colors are not the same in the two palettes.
Of course you can make pre-defined palettes to be used in the same drawing.
You could use this to make several different versions of the same drawing provided all the used colors are in the original palette.
No problem generating palettes with a lot of values - just experimented with a 10000 line palette file, takes a while to load but works OK.

To change colors based on "nearest" color would be more work and is also a subjective thing - (learned from all the girls in the house)

Replacing colors in filters can be done as all the filters are using the same hex code for colors.
If you look at the code all the RGB values in the palette files are converted into a list of hex values before the replacement takes place.

At least if the extension is not useful or obsolete or redundant it was fun to code - learned a few things in the process.

Found the extension to not work satisfactorily if the same color appears more than once in the palette file. Fix in progress.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Swap Palette Colors - Extension

Postby Lazur » Mon May 20, 2013 12:43 pm

I understand that the extension is based on the rgb hex codes of the colours.
My problem was, like, you want your drawing entirelly to be represented from a palette, then change the palette to another one.
If a colour's swap colour is represented in the original palette, it will be able to swap again, while it shouldn't.
I'm thinking this because if you swap a white wall to black, AND you swap the colour again to black -by like an accident-, it could turn out green.

The nearest colour would be based on HSL space coordinates.
Until coloroid or such take a wider usage it is the closest.
Maybe RGB space could work too?

Or else: what if the colours that are not on the first palette would turn to another colour?
That way you could see what part of the drawing you should pick a different colour for.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Mon May 20, 2013 1:04 pm

Hi

Or else: what if the colours that are not on the first palette would turn to another colour?
That way you could see what part of the drawing you should pick a different colour for.


Good idéa! Easy to implement as well. ( Extend the extension!! )

If a colour's swap colour is represented in the original palette, it will be able to swap again, while it shouldn't.

It's always difficult to "protect" the user from them-self - you don't have to apply the extension twice!

Nice figure! Also interesting article - on the source page.
Would like to be able to plot it myself!

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
lejimi
Posts: 54
Joined: Sat Jun 23, 2012 1:21 am
Location: Bourges (France)

Re: Swap Palette Colors - Extension

Postby lejimi » Mon May 20, 2013 3:36 pm

Hi !

I tested your file and it doesn't seem to run on my system. I ge this error message :
Image

Maybe an issue with my Python installation ? Anyway that file name (just one point !) seems strange to me. I use Ubuntu 12.04 and my Inkscape version is Inkscape 0.48.3.1 r9886. And here are my Pythons :

Code: Select all

sam@sam-bureau:~$ python --version
Python 2.7.3
sam@sam-bureau:~$ python3 --version
Python 3.2.3


When you open the extension, you have to enter the path to the palettes in text fields. Maybe you could add a browse button to open a file chooser window ? Or perhaps use dropbox menus to allow the choice among palettes loaded by Inkscape ?
Inkscape 0.91 / Ubuntu 12.04
Inkscape 0.91 / Debian Wheezy

Gloire à qui n'ayant pas d'idéal sacro-saint
Se borne à ne pas trop emmerder ses voisins

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Mon May 20, 2013 11:52 pm

Hi lejmi

Can you run other extensions based on python?
On my system the python interpreter used by Inkscape are part of the Inkscape installation.
It is residing in: installdir/inkscape/python

I have Python 2.7.4 installed but Inkscape uses "its own" 2.6.5. found in installdir/inkscape/python.
Looks like you are on a Mac?
If that's the case have a look at these;
Edit; Links deleted as they were obsolete - Thanks ~suv
Does your python complain about any of these dependencies;

Code: Select all

import sys
import inkex
import simplestyle
import copy


A file requester is a good Idéa, don't know how easy it is to implement from extensions - will have a look.
Documentation for the extension subsystem is hard to find, are mostly learning by looking at already existing extensions.

RGDS
Ragnar
Last edited by ragstian on Tue May 21, 2013 7:19 am, edited 3 times in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Swap Palette Colors - Extension

Postby ~suv » Tue May 21, 2013 6:07 am

Off topic:
ragstian wrote:Looks like you are on a Mac?
Not based on the screenshot, and the information provided in the comment (hint: Ubuntu).
ragstian wrote:If that's the case have a look at these;
[url]http://caih.org/open-source-software/fixing-inkscape-in-mac-os-x/[/url]
Very dated blog entry for an old Inkscape package for Mac OS X (0.46), not recommended IMvHO (unless you tested and confirmed yourself that this old tip for Inkscape 0.46 on older versions of Mac OS X also solves a different underlying issue Inkscape users currently have with python-based extensions in Inkscape 0.48.2 on the latest versions of OS X (Lion, Mountain Lion)). Personally I would never recommend to Mac users to manually touch or modify files in '/usr/lib' (or '/usr' in general) - this is "Apple land", and any modifications there have a high risk to cause trouble elsewhere (e.g. break other applications).
ragstian wrote:[url]http://permalink.gmane.org/gmane.comp.graphics.inkscape.devel/39616[/url]
A discussion on the developers' mailing list about compiling and bundling new Mac packages, made obsolete with later RC packages by Valerio. Does not include instructions for regular Inkscape users to work around the known issue with extensions on Lion and Mountain Lion (such instructions can be found e.g. in this earlier forum topic (or directly here)).

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Tue May 21, 2013 7:30 am

Hi

~suv; Thanks for the info.
Any idéa why the extension does not work on Ububtu?

Updated version (Untested on Ubuntu :) )
Edit - File obsolete. See later post.

RGDS
Ragnar
Last edited by ragstian on Tue May 21, 2013 10:59 am, edited 1 time in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Swap Palette Colors - Extension

Postby Lazur » Tue May 21, 2013 7:59 am

When turned on the debug message, inkscape stops responting here, when using on the third line of that attached svg.
When used on one object with a random colour, it "works".
Produces this message when a non-palette colour is used, nothing else:

Debug on

Using palette files

C:\Program Files\Inkscape\share\palettes\avr_vga.gpl

C:\Program Files\Inkscape\share\palettes\avr_vga_sorted.gpl



4 - Header lines in palette file: C:\Program Files\Inkscape\share\palettes\avr_vga.gpl



Color dict from old palette:['#7fffff', '#0000ff', '#00ffff', '#000000', '#ff0000', '#ff7fff', '#ff7f7f', '#ffffff', '#7f007f', '#00ff00', '#7f00ff', '#007fff', '#007f7f', '#ffff00', '#00007f', '#00ff7f', '#ff00ff', '#007f00', '#7f0000', '#ffff7f', '#7fff00', '#ff007f', '#7f7f00', '#ff7f00', '#7fff7f', '#7f7fff', '#7f7f7f']

Color dict from new palette:['#7fffff', '#0000ff', '#00ffff', '#000000', '#ff0000', '#ff7fff', '#ff7f7f', '#ffffff', '#7f007f', '#00ff00', '#7f00ff', '#007fff', '#007f7f', '#ffff00', '#00007f', '#00ff7f', '#ff00ff', '#007f00', '#7f0000', '#ffff7f', '#7fff00', '#ff007f', '#7f7f00', '#ff7f00', '#7fff7f', '#7f7fff', '#7f7f7f']



Found Color: #007f00 at index 18 in the palette, item; color #007f00

New Color: #7fffff



A total of: 1 was done.


After running it once, it has to be closed for a second use -an intentional way of preventing accidental double swapping?

When nothing is selected you can run it though, and gives the error message
None of the selected items had a

color that matched the palette

or no items was selected.
,
but when an object with a colour that didn't mach the palette is selected, no message is given.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Tue May 21, 2013 9:15 am

Hi.

Found one bug from your listing, the color dictionaries listed are from the same file, fixed.

After running it once, it has to be closed for a second use -an intentional way of preventing accidental double swapping?

Not intentional, does not happen here, I can run it over and over without exciting, will check with same files as you used.
but when an object with a colour that didn't mach the palette is selected, no message is given.

A message is supposed to come up if no colors are swapped, will check the code.
Thanks for helping me debugging the extension.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Swap Palette Colors - Extension

Postby Lazur » Tue May 21, 2013 10:06 am

Thank you for the coding!

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Tue May 21, 2013 10:14 am

Hi Lazur URH

Updated version.
Could not re-create the errors you found.
Sometimes the extension seems to "hang" when operating on many objects with debug option on.
Debug option is really for debugging - will be removed once the extension has "matured".
Does your debug window have the lines spaced as in your cut & paste example?
Mine lines are single spaced - yours are double.

Edit; obsolete version deleted.

RGDS
Ragnar
Last edited by ragstian on Wed May 22, 2013 6:09 am, edited 1 time in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Swap Palette Colors - Extension

Postby brynn » Tue May 21, 2013 12:07 pm

When this reaches a final version, you should post in Inkscape Resources board (with link to this topic). Unless it's finished now, I can move the whole thing. Lmk :D

User avatar
lejimi
Posts: 54
Joined: Sat Jun 23, 2012 1:21 am
Location: Bourges (France)

Re: Swap Palette Colors - Extension

Postby lejimi » Tue May 21, 2013 4:30 pm

Hi !

That's what my python says (the default one in /usr/bin/, not the inkscape one, I'm a Ubuntu user) :

Code: Select all

Sam@sam-bureau:~$ python
Python 2.7.3 (default, Aug  1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import inkex
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named inkex
>>> import simplestyle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named simplestyle
>>> import copy
>>>


So it seems that you are right, Inkscape tries to use the default Inkscape rather than its own one (could you suggest the name of another Python based extension, so that I couls check it ?). I don't where Inkscape's own Python installed in Ubuntu. Inkex ans simplestyle are in /usr/share/inkscape/extension/ but there's no snake here :-)

Perhaps using default Python is a normal behavior for Inkscpae with Ubuntu ?
Inkscape 0.91 / Ubuntu 12.04
Inkscape 0.91 / Debian Wheezy

Gloire à qui n'ayant pas d'idéal sacro-saint
Se borne à ne pas trop emmerder ses voisins

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Tue May 21, 2013 4:53 pm

Hi

Will install Ubuntu on my machine to try.
The path to the "correct" (for the extension) Python interpreter can be added to the "swap_palettes.py" file as the first line.
It's called a "she-bang" - do a google search.

Normally it looks like this;

Code: Select all

#! /usr/bin/env python
import sys
import inkex
import simplestyle
import copy

Yours should be something like;

Code: Select all

#! /usr/share/inkscape/python/
import sys
import inkex
import simplestyle
import copy

Correct this according to your inkscape python path.
( Make sure you are not applying this to other python source files as they will then use the Inkscape/python interpreter. :) )

I am currently "fixing" the extension - got a huge speedup when using a large palette file and operating on lots of objects - by eliminating a "for next" loop.
Stay tuned for updates.
I am also working on some better examples showing the "usefulness" of the extension.

Have a look at this;
http://inkscape-forum.andreas-s.net/topic/4404839

~suv - the expert - might chime in again if I have "goofed" on this!

RGDS
Ragnar
Last edited by ragstian on Tue May 21, 2013 5:08 pm, edited 2 times in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Tue May 21, 2013 5:02 pm

Hi brynn
When this reaches a final version, you should post in Inkscape Resources board (with link to this topic). Unless it's finished now, I can move the whole thing. Lmk :D

Still working on this, the real "acid test" and debugging will start if or when flamingolady "discovers" it :D

You mean moving it on this forum? Or somewhere else?

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Swap Palette Colors - Extension

Postby Lazur » Tue May 21, 2013 9:48 pm

Now when used if nothing is selected, the error message appears right.
Image
Image

When used on a non-palette coloured object:
Image
If debug message unticked, no message given, just simply closes the extension.

When used on two colours of that third row, it shows the message if that was thicked,
then ddoes the swapping after you click "OK" on that text panel -previously it didn't work that way, it did either the message or the effect.
Image

When used on the whole third row, it still freezes inkscape.
And still it doesn't work after once applied -cannot select objects of the drawing, nor pan the drawing after once it's applied.

The previous error messages were the same like, they were copy/pasted, so maybe the forum added that extra space to them.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Swap Palette Colors - Extension

Postby ~suv » Wed May 22, 2013 3:34 am

Comments based on the extension shared in this earlier comment:
ragstian wrote:Updated version.
Could not re-create the errors you found.
Sometimes the extension seems to "hang" when operating on many objects with debug option on.
Debug option is really for debugging - will be removed once the extension has "matured".
Does your debug window have the lines spaced as in your cut & paste example?
Mine lines are single spaced - yours are double.

Swap_palettes_extension.zip

Some quick comments:
  1. Capitalisation: the extension likely fails on case-sensitive file systems: please be careful to not randomly switch lower-/uppercase letters in file names (e.g. when referencing dependencies and scripts in INX files) - it does matter (at least outside the Microsoft Windows cosmos).
  2. Shebang: earlier you wrote “Documentation for the extension subsystem is hard to find, are mostly learning by looking at already existing extensions.”. Is there any special reason you chose to not include the shebang line in your python script? It is included in each python extension script distributed with Inkscape 0.48.4 (as well as current trunk)…
  3. Menu structure: I would recommend to add the extension to the existing 'Extensions > Color' sub-menu: this would avoid the current redundancy ('Extensions > Swap_Palettes > Swap_Palettes'), and likely be a useful addition to the existing color extension in that sub-menu to replace an individual color with a different one…
  4. Consistency: I would recommend to code the behavior of your extension similarly to the existing 'Color' extensions: with no current selection, use the whole drawing content as context, else only affect the objects in the current selection. I'd probably also add the live preview option…
  5. Shared code: does your extension handle e.g. color values defined in gradients? I would recommend to study the color extensions distributed with inkscape - possibly you can reuse (by import, not by copy&paste) some of the underlying code in 'share/extensions/coloreffect.py' to parse the used colors in the drawing/selection?
  6. Versioning: it would make testing easier if you added a version number (or date, or similar) to the file name of the zip archives you upload in this topic - thus allowing to know right away whether one tests the latest version or not.

Somewhat off-topic: I would recommend to test the extension with current stable Inkscape (0.48.x) instead of development snapshot builds (the development builds have some known regressions with extensions which modify color values, and often either crash or hang when applying such extensions in certain drawings).

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Swap Palette Colors - Extension

Postby ragstian » Wed May 22, 2013 5:20 am

Hi ~suv

Thanks for the feedback. As you might have seen from my code I'am not a "professional" programmer, just doing this for fun. I am "learning by doing" as I go along. I am fully aware that I got a long way to go! I will try to implement your suggestions.

Some comments & questions;
    Capitalisation: Can you give me some pointers on how to handle "case sensivity"? I can have my script change the case but then the user got no "control" over file-name case. Are there any file dialogs I can use from XML?
    Shebang: Will add to file. Sorry for having overlooked this.
    Menu structure: The final version of the extension will "reside" under Extension-Colors, for me it's handy to have it as a separate entry in the extension list while testing.
    Consistency: I have made a conscious choice by NOT having the extension apply the changes to the whole document. I am using Inkscape to edit some maps containing elevation and depth gradients, logos, text etc. that I do not want to change. If I want to change the colors of the depth gradient but NOT the elevation gradient I would have to use two different palettes if the extension operated on the whole document instead of a selection. I would also have to make sure that no colors from one palette exists in the other.)
    Shared Code: I will study the color handling in Inkscape - I have studied some to make my own "Palette Generators" but there are always more to learn.
    Version numbers:I will apply versions just as I did in my "Cartesian Grid" extension from now on, thanks for the tip.
    Live preview: I got problems on my system using the "Live Preview" where the extension fails to update (after a while) and the dialog have to be closed & re-opened to work again. Until I can figure out why i got the "Live Preview" turned off.
Will also test the code on a stable release, I have several "Instances" of Inkscape on my system - All working!
I will also test on Ubuntu - ( I have now got a Ubuntu system to test on :) ) - before I submit any more updates.

Thanks for your help, it's really appreciated.

RGDS
Ragnar
Last edited by ragstian on Wed May 22, 2013 6:30 am, edited 6 times in total.
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
lejimi
Posts: 54
Joined: Sat Jun 23, 2012 1:21 am
Location: Bourges (France)

Re: Swap Palette Colors - Extension

Postby lejimi » Wed May 22, 2013 6:19 am

Hi ! I guessed about the !# the trouble is that I'm unable to find where's the Inkscape's special python. I found /usr/share/inkscape, but there's no python subfolder in it...
Inkscape 0.91 / Ubuntu 12.04
Inkscape 0.91 / Debian Wheezy

Gloire à qui n'ayant pas d'idéal sacro-saint
Se borne à ne pas trop emmerder ses voisins


Return to “Help with using Inkscape”