extension color_type returns long
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
New
|
Wishlist
|
Unassigned |
Bug Description
When making an extension the user can select type color.
e.g. in inx file:
<!-- color is just like an int. BUT only single use on a page-->
<param name="strokeColour" type="color" gui-text="Line colour: ">0</param>
In py file:
self.OptionPars
Type does not affect result. The value returned is a signed long. It should be a string in color form.
This signed value can be converted by this function into a color string.
def getColorString(
""" Convert the long into a #RRGGBB color value
- verbose=true pops up value for use in defaults
"""
if verbose: inkex.debug("%s ="%(longColor))
longColor = long(longColor)
if longColor <0: longColor = long(longColor) & 0xFFFFFFFF
hexColor = hex(longColor)
hexColor = '#' + hexColor.rjust(6, '0').upper()
if verbose: inkex.debug(" %s for color default value"%(hexColor))
return hexColor
Request:
It should be returning a string in form "#RRGGBB".
This would also mean the default value could be a color string. ATM it needs to be a signed long.
For compatibility with existing extensions - some solution needs to be worked out, or just break them and we will fix them.
tags: | added: color extensions-plugins |
Changed in inkscape: | |
importance: | Undecided → Wishlist |
FWIW - I concur with su_v