plugdata icon indicating copy to clipboard operation
plugdata copied to clipboard

Request or question: Object colors in RGBA instead of RGB?

Open jayrope opened this issue 6 months ago • 7 comments

Question, or request:

Can we set object colors in rgba instead of rgb at the moment?

Use case: Overlay a graph of a waveform (an array) with an hsl of the same value range. The hsl bar (red in attached image) can then be used as a position pointer as well as to choose the start point of the array, for instance for audio playback, as well as prohibits accidental waveform/array changes arising from unwanted clicking into the graph.

This method seems currently not possible, because i can't seem to set the hsl background color to a transparent value.

Any help?

Thanks a lot in advance!

Image

jayrope avatar Jun 28 '25 13:06 jayrope

no, this is not currently possible in vanilla plugdata, but I definitely agree that this would be a good feature!

i was doing some proof of concept tests by modifying ArrayObject.h to add transparency and also a way to fill below a curve (image attached below) and got some pretty good results. it would be really cool to have something similar as official features of plugdata!

Image

girldeth avatar Jun 28 '25 19:06 girldeth

no, this is not currently possible in vanilla plugdata

Do you mean pd-vanilla or plugdata? (using the term vanilla with plugdata adds confusion)

You can of course add a pull request to add this feature!

dromer avatar Jun 28 '25 22:06 dromer

sorry i meant just its not possible in plugdata currently. and yeah, once I fix some of the bugs and make sure it's working, I'll probably submit a pr!

girldeth avatar Jun 29 '25 17:06 girldeth

Adding RGBA is tricky because it may add an inconsistency/incompatibility to objects/patches. This seems easier If we add such feature to ELSE gui objects. We can try adding this for the [knob] object as a test. It'd be a message/feature that only works for plugdata, of course.

What you want is possible in Vanilla, but for a reason that is not really "good". In tcl/tk the item that is behind gets the click. So just put an array (which is transparent) on top of a slider. It's not the same as having an opaqueness, but you can see the array on top of the slider and see the slider bar behind the sample.

Here's a patch

test.pd.zip

Now, this doesn't work in plugdata because items on front will get the click, but in the case of arrays, I think that if you disable editing (and therefore clicking), one should be able to access the item behind the array. So in my intuition this patch not working seems like a bug!

Is there any good reason that makes it impossible for the slider to get the click if the array is not editable?

porres avatar Jun 29 '25 19:06 porres

prohibits accidental waveform/array changes arising from unwanted clicking into the graph.

@jayrope this is currently not an issue, since we can set arrays as "read only" and not take mouse clicks

porres avatar Jun 29 '25 19:06 porres

Oh, we've been talking about adding transparency to iemguis by the way... this would allow us to use a transparent slider on top of the array (with 'edit 0') as a way that should work for both Vanilla and PlugData. The slider value bar would be on top of the sample, but I don't see that as a problem. See https://github.com/pure-data/pure-data/issues/2639#issuecomment-3008085279

porres avatar Jun 29 '25 19:06 porres

so, moving my request to a new issue https://github.com/plugdata-team/plugdata/issues/2137

porres avatar Jun 29 '25 19:06 porres