Multicolor for rows
Multicolor for rows
Hi all,
This may be something so simple it's escaping my grasp, but I'm having a really hard time trying to write a script to give each row of my switches a different color.
The typical setattribute 'colors' etc is great if you want to do a certain repeating set or columns but doing rows seems more difficult.
Anyone had any luck?
This may be something so simple it's escaping my grasp, but I'm having a really hard time trying to write a script to give each row of my switches a different color.
The typical setattribute 'colors' etc is great if you want to do a certain repeating set or columns but doing rows seems more difficult.
Anyone had any luck?
-
- Regular
- Posts: 114
- Joined: 31 May 2015 18:45
- Location: Austin, TX
Re: Multicolor for rows
Are you trying to get the entire row the same color or each individual switch? Is it a single row of switches or is it a grid of rows and columns? Could you just use individual switches if you're trying to make each switch a different color and line them so it looks like a row? If you did that you wouldn't need to use set attribute.
Have you tried turning it off and on again?
Re: Multicolor for rows
I have a large grid of switches which I'm using for program changes. I could make individual switches but that would take so much more work compared to a grid. I don't necessarily need to control the colour of every switch, but I'd like to have the option to colour the rows a different colours so it's not just one block of the same thing.
Re: Multicolor for rows
I think this is something you're looking for.
This takes two colors, color_odd for the odd rows and color_even for the even rows. It then calculates the number of rows and columns and alternates the color between the rows.
It has comments so you'll probably be able to expand this to other number of colors;)
Cheers!
This takes two colors, color_odd for the odd rows and color_even for the even rows. It then calculates the number of rows and columns and alternates the color between the rows.
It has comments so you'll probably be able to expand this to other number of colors;)
Cheers!
- Attachments
-
- colors.jzml
- (3.43 KiB) Downloaded 101 times
"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
-
- Regular
- Posts: 315
- Joined: 02 Nov 2013 11:19
Re: Multicolor for rows
funny, I was just about to upload an example as well.
Since it's done, here you go.
Press and hold the button on the right to set the colors, when you release it, they go back to a default.
The script shows how to manipulate all and also individual cells.
Since it's done, here you go.
Press and hold the button on the right to set the colors, when you release it, they go back to a default.
The script shows how to manipulate all and also individual cells.
- Attachments
-
- ColorSwitch.jzml
- (3.55 KiB) Downloaded 109 times
-
- Regular
- Posts: 114
- Joined: 31 May 2015 18:45
- Location: Austin, TX
Re: Multicolor for rows
Dang, I was so close. I was trying to set them with setattribute(Switch[0],'colors',blahblahblah);
Have you tried turning it off and on again?
-
- Regular
- Posts: 315
- Joined: 02 Nov 2013 11:19
Re: Multicolor for rows
Yeah, you'd thinkphase_change wrote:Dang, I was so close. I was trying to set them with setattribute(Switch[0],'colors',blahblahblah);
Code: Select all
setattribute(Switch[0],'color', {background, foreground});
Code: Select all
setattribute(Switch,'color',{background, foreground});
NB - using the colors attribute implies specifying the background color for all switches in the following value array. The singular color is for the general overall background and foreground. The side effect is that you can customize the background colors but not the foreground.
Re: Multicolor for rows
Thanks so much for all the help!
You guys are definitely on to something.
You guys are definitely on to something.
-
- Regular
- Posts: 315
- Joined: 02 Nov 2013 11:19
Re: Multicolor for rows
or maybe just on something.mesquire wrote:Thanks so much for all the help!
You guys are definitely on to something.
Working with Lemur is a unique experience.
There's usually a way to do what you want, it just may be different than you planned.