Multicolor for rows

Discuss Lemur and share techniques.
Post Reply
mesquire
Newbie
Posts:8
Joined:06 Oct 2016 03:35
Multicolor for rows

Post by mesquire » 05 Dec 2016 10:29

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?

phase_change
Regular
Posts:114
Joined:31 May 2015 18:45
Location:Austin, TX

Re: Multicolor for rows

Post by phase_change » 05 Dec 2016 17:12

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?

mesquire
Newbie
Posts:8
Joined:06 Oct 2016 03:35

Re: Multicolor for rows

Post by mesquire » 06 Dec 2016 04:06

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.

MrCorba
Regular
Posts:143
Joined:02 Sep 2013 20:17
Location:Netherlands

Re: Multicolor for rows

Post by MrCorba » 06 Dec 2016 20:39

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!
Attachments
colors.jzml
(3.43KiB)Downloaded 115 times
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: Multicolor for rows

Post by oldgearguy » 07 Dec 2016 09:57

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.
Attachments
ColorSwitch.jzml
(3.55KiB)Downloaded 122 times

phase_change
Regular
Posts:114
Joined:31 May 2015 18:45
Location:Austin, TX

Re: Multicolor for rows

Post by phase_change » 07 Dec 2016 12:08

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?

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: Multicolor for rows

Post by oldgearguy » 07 Dec 2016 15:57

phase_change wrote:Dang, I was so close. I was trying to set them with setattribute(Switch[0],'colors',blahblahblah);
Yeah, you'd think

Code: Select all

setattribute(Switch[0],'color', {background, foreground});
would work to set an individual switch color in the matrix but it doesn't seem to work. It will work to set the overall bg/fg color is you do this:

Code: Select all

setattribute(Switch,'color',{background, foreground});
but as soon as you subscript the switch matrix, Lemur gets confused.

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.

mesquire
Newbie
Posts:8
Joined:06 Oct 2016 03:35

Re: Multicolor for rows

Post by mesquire » 11 Dec 2016 11:53

Thanks so much for all the help!
You guys are definitely on to something.

oldgearguy
Regular
Posts:315
Joined:02 Nov 2013 11:19

Re: Multicolor for rows

Post by oldgearguy » 12 Dec 2016 15:29

mesquire wrote:Thanks so much for all the help!
You guys are definitely on to something.
or maybe just on something. :o
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.

Post Reply