Hi,
wondering if it a way to have a switch object say with 4 switches, and have multicolor assigned to them, but to ON state?
see image,
I want switches to be in Radio Mode, and all to be grey colored, so when I select any one of them, they should turn on with the colors defined by me.
On-State Multicolor
Re: On-State Multicolor
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"....
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)
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"....
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)
-
- Newbie
- Posts: 9
- Joined: 22 May 2013 13:02
Re: On-State Multicolor
Thanks Softcore !!
it was the first solution that I was looking for radio mode !!
thanks !!
it was the first solution that I was looking for radio mode !!
thanks !!
Re: On-State Multicolor
I just noticed something in your image.....
Definitely make the scripts onLoad and not onFrame - you dont want precious cpu cycles wasted with an onframe script (which will be continuously executed) for something you only need to set once, when the template loads.
Definitely make the scripts onLoad and not onFrame - you dont want precious cpu cycles wasted with an onframe script (which will be continuously executed) for something you only need to set once, when the template loads.
Re: On-State Multicolor
"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
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
Re: On-State Multicolor
I don't really get your question... Can you post a project with some code?
Maybe then I can help you
Maybe then I can help you
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
https://soundcloud.com/mrcorba
Re: On-State Multicolor
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
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