However the boolean seems to be not right passed. It just passes True, no matter if I check or uncheck the boolean. My second problem is that I cannot set the default color. For example in my code I want the default color to be green, #00FF00FF in RGBA representation. But Inkscape doesn't accept the default. How can I change this? And can I get the color string in python?
My python code looks like the following. It will just return the passed parameters.
Me neither. I experimented a bit. And sometimes I was able to set a default color, which was kind of random. I just set in some big interger number (like in the code snippet), assuming that the default color is in RGBAint format. But the resulting color was different from the expected one. The example should return red #FF0000 as default.
No the example above doesn't include the alpha value. But this int does: 4294967040. It should be red with full alpha.
In further tests, I was not able to change the color via the .inx file anymore. The behavior was unreproducible. So maybe your are right and a default value for the color parameter is not included (yet).
Hi, I'm trying to pass some arguments from the Inkscape extension to my Python script. The .inx file is looking like this:
However the boolean seems to be not right passed. It just passes True, no matter if I check or uncheck the boolean. My second problem is that I cannot set the default color. For example in my code I want the default color to be green, #00FF00FF in RGBA representation. But Inkscape doesn't accept the default. How can I change this? And can I get the color string in python?
My python code looks like the following. It will just return the passed parameters.
Can somebody help with the problems?
There was a mistake of the types in my python code. The type of boolen has to be "inkex.Boolean" and of color "inkex.Color" respectively.
However I'm still not able to set a default color in the .inx file. What is the color representation?
I've not seen a default colour being set. It might not be possible (but I hope it is!)
Me neither. I experimented a bit. And sometimes I was able to set a default color, which was kind of random. I just set in some big interger number (like in the code snippet), assuming that the default color is in RGBAint format. But the resulting color was different from the expected one. The example should return red #FF0000 as default.
Does the number include alpha as the first 8 bits?
No the example above doesn't include the alpha value. But this int does: 4294967040. It should be red with full alpha.
In further tests, I was not able to change the color via the .inx file anymore. The behavior was unreproducible. So maybe your are right and a default value for the color parameter is not included (yet).