panel bgfillcolor, change only alpha?

Ploki's icon

is there a way to tell max to only change alpha value of bgfillcolor attribute?

monetus's icon

if you look at the inspector when you have the panel selected, you can actually click the bgfillcolor attribute and drag it into your patcher as a message. For changing alpha only, you would need the fourth number to be variable (e.g. [bgfillcolor 40. 50. 40. $1]). Maybe use? toggle -> *100. -> append 50.->line 0.

Ploki's icon

Should have been more clear; i meant change only alpha with values, so you can use the main color Style as defined by a preset

edit: also think values are normalised 0. - 1.

monetus's icon

oh ya, they are normalized. It seems once you change a color, that is stored in memory and won't change when you change styles. You will have to poll for the background color when you change presets. I only have the live version, So I would use live.colors or bgcolor. Not entirely sure how to get more of the color scheme values into max by itself. Maybe thispatcher.
*edit https://docs.cycling74.com/max5/refpages/max-ref/suckah.html I bet clever use of this would do it.

Charles Matthews's icon

I have a feeling you could do this by constructing a message with [getattr], but I can't seem to get the object to work in Max7.

Ploki's icon

weird, seems totally mundane and something stupid I'm overlooking

Charles Matthews's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's a patch demonstrating what I meant, but for some reason I can't get getattr to listen to panel's bgfillcolor - which is odd because it was in the help file for 6..

Ben Bracken's icon
Max Patch
Copy patch and select New From Clipboard in Max.

bgfillcolor is technically a dictionary, so it is a little harder to set in this way. You can always set it using a list, but then you don't get a gradient. Here is a hasty example. The second example assumes you aren't listening for what the current color is, you are just setting it:

Charles Matthews's icon

That's really useful to know, thanks!

Max Patch
Copy patch and select New From Clipboard in Max.

So I guess to answer the original question, could do something like this to set multiple objects from the same style:

Ploki's icon

@Ben Bracken: first example works with "Styles", but its choppy as heck, and I need to wrap my head around how it works in the first place.

@Charles: nice example for gradients.