scaling of (r,g,b) parameters in Effects|Color|Custom... extension

Bug #186432 reported by Alvin Penner
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Alvin Penner

Bug Description

this is not a bug, but a proposal for a change in the user-interface.

When using the extension Color | Custom... on the Effects menu, if one wants to specify a constant value for the (r,g,b) parameters, it is necessary to use a floating point number, with a decimal point, in the range (0,1). So, for example, specifying red = 0.5 will yield red = 128 on the display. Normal usage for (r,g,b) parameters is that they are integers in the range (0,255).

Revision history for this message
Alvin Penner (apenner) wrote :

The file \Inkscape\share\extensions\color_custom.py has been modified to allow for this type of usage. New version is attached.

The file has been tested with the following inputs :
Red Function = (r+g)/2
Red Function = r + 11
Red Function = 59
It appears to behave appropriately in these cases.

Revision history for this message
bbyak (buliabyak) wrote :

So you just switched the inputs from 0..1 to 0..255. This is not very useful and will break other people's formulas that they used before. If you want 255, please just add a switch to the interface that would hint the script which input range is used.

Revision history for this message
Alvin Penner (apenner) wrote :

removed attachment, will try to re-submit later

Revision history for this message
Alvin Penner (apenner) wrote :

The files \Inkscape\share\extensions\color_custom.py and *.inx have been modified to allow for two types of input color range for (r,g,b) : 0-1 (which is the default) and 0-255 (which is new). New versions of these files are attached.

The files have been tested with the above values for the 0-255 range and with the following values for the 0-1 range :
Red Function = (r+g)/2
Red Function = r + 11.0/255
Red Function = 59.0/255

It appears to behave appropriately in these cases.

Revision history for this message
Alvin Penner (apenner) wrote :

change text

Tom Davidson (tjd-mit)
Changed in inkscape:
importance: Undecided → Wishlist
status: New → In Progress
Revision history for this message
Alvin Penner (apenner) wrote :

modifying .inx file to be compatible with the new xml format for .inx files.

Just a question, would it be possible for someone to evaluate this change to see if they like it, this proposal has been marked "In Progress" for a while...

Thanks,
Alvin

tags: added: extensions-plugins
removed: extensions
Revision history for this message
jazzynico (jazzynico) wrote :

Interesting proposal which could be tested in the trunk. I'd just replace the radio buttons with a list.
Setting milestone to the next major version.

Alvin, do you mind if I assign this report to you? Just tell me if you don't want or have no time to modify the current extension files so that I assign it to myself.

Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
milestone: none → 0.49
Revision history for this message
Alvin Penner (apenner) wrote :

Hi,
    I am editing the original proposal to make it compatible with current code. However, while doing this I am getting occasional crashes, not very reproducible, but still recurring:

- Windows XP, Inkscape 0.48.0 r9654 (Aug 16 2010)
- Python files, color_custom.py and color_custom.inx, from bzr rev 9739

backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x0140f566 in Gtk::Tooltips::set_tip ()
   from D:\PROGRA~1\Inkscape\libgtkmm-2.4-1.dll
(gdb) bt
#0 0x0140f566 in Gtk::Tooltips::set_tip ()
   from D:\PROGRA~1\Inkscape\libgtkmm-2.4-1.dll
Cannot access memory at address 0x22f040
(gdb) c
Continuing.
error return win32-nat.c:1254 was 31

Revision history for this message
jazzynico (jazzynico) wrote :

Ouch, you're right. That's something I noticed some days ago when an extension UI has both a tab and tooltips... I suspect a memory management issue, but it's a bit deep in the code. Anyway, I've stopped adding tooltips as soon as I noticed the bug and thus the other extensions should not be affected.

In this case, the tooltips are not critical (the tab is more useful), and you can remove them completely to prevent the extension from crashing.

Revision history for this message
Alvin Penner (apenner) wrote :

yes, thanks, that seems to have solved the problem. I removed the _gui-description from the inx file.

Attached are new versions of the two files, these have been edited to be more consistent with current bzr.

Revision history for this message
Alvin Penner (apenner) wrote :

these have been tested using formulas as in comment 4 above.
The change in scale affects only those parts of the formula that contain colors specified as constants.

Revision history for this message
jazzynico (jazzynico) wrote :

Tested on Ubuntu 10.04. Everything works as expected.
I'd rather see the new option in the option tab, and not outside the notebook (don't hesitate to tell me if I'm too fussy ;)

Revision history for this message
Alvin Penner (apenner) wrote :

no problem, attached is a modified .inx file.

I'll wait for a few days, and if no new issues show up, then I'll commit it, thanks for the testing.

Revision history for this message
Alvin Penner (apenner) wrote :

committed to bzr rev 9794

Changed in inkscape:
status: In Progress → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.