Troubleshooting

On-State Multicolor

Started by somethingnew on .

Sign in or create an account to join the conversation.

7 posts

Interesting circumstance.....

There is no multi-on color option for the switches - multicolor refers to off states....

So there are two possible apporaches:

1. The convenience that you want radio buttons (only one switch on at any given time) means we can get away by scripting changes of on state color (even if it means for ALL the buttons only one will be visible and have the specified color). This approach goes messy of course if you disable "radio"....

radio-oncolors.jzml

2. What if we didnt want radio but did want different on colors? wellll, multicolor attribute helps with the off colors so we can just use an inverted x expression as output (out=1-x) and thus treat our switches as if the "on" color is the off (all grey) and the off color is the "on" (multicolor scripting will take it care)

fullcompatible-oncolors.jzml
"so we can just use an inverted x expression as output (out=1-x) and thus treat our switches as if the "on" color is the off (all grey) and the off color is the "on" (multicolor scripting will take it care)"

What?

I have 8 switches (Remotes), I have a multi-slider (ColorSelect 3 sliders R,G,B) and a single pad (CurColor)
ColorSelect is to mix a color and put it in the ON color of CurColor

setattribute(CurColor,'colors',{RGB(x[0],x[1],x[2])});

As I flip switches (Remotes) I want to put CurColor into the OFF color of Remotes. Right now when a switch flips, ALL the switches turn the same color:
decl onColor;
onColor = getattribute(CurColor,'colors');
if (x[0] == 1) setattribute(REMOTES, 'color', {0, onColor});
if (x[1] == 1) setattribute(REMOTES, 'color', {0, onColor});
if (x[2] == 1) setattribute(REMOTES, 'color', {0, onColor});
if (x[3] == 1) setattribute(REMOTES, 'color', {0, onColor});
if (x[4] == 1) setattribute(REMOTES, 'color', {0, onColor});
if (x[5] == 1) setattribute(REMOTES, 'color', {0, onColor});
if (x[6] == 1) setattribute(REMOTES, 'color', {0, onColor});
if (x[7] == 1) setattribute(REMOTES, 'color', {0, onColor});
TIA fr any suggestions!

Best,
joeb
Thanks for the response!
Posting the app would be a chore. It's like 80% on the little green pie chart.
Let me state it more simply; get the color of an object, set the background (OFF) color of a multi color switch in a switches object to the color of the object.

Thanks again,

Joe B