How to dynamically change the color of a figure inside jit.lcd

Emanuel Garay's icon


Good evening, I need a little help .. I'm new to it, and I want to create a very special patch to have fun and learn how to use max I wanted to know, how do I change the color of a figure inside an jit.lcd object by switching it from one color to another (or more) giving me the possibility to set a fadein THANK YOU

Max Gardener's icon

You can use the following method this time, and the next time you've got a queston, too

1. Open a patcher window
2. Add an lcd UI object. Click on the object to select it.
3. Click on the Reference icon on the right-hand side of the toolbar. That'll open the ref page for the object, and you'll see a list of the messages the object works with.
4. Click on the "brgb - set the background color" entry, since that looks good.
At the bottom, you'll see "Set the background color," which isn't too helpful. In a case like that, you'll want to look at the full Ref page rather than a summary
5. See the icon with the three horizontal lines at the bottom of the Reference tab there (it's marked "Open Full Reference)? Click on it and a documentation browser will open.
6. Scroll down until you see the listing for brgb. You'll notice that it lists three arguments for red, green, and blue, each of which is an int (integer).
That means that the message you use to set the color of an LCD is "brgb <int> <int> <int>".
And, since they're integers rather than floating-point numbers, those three integers will be between 0 and 255.
7. Add a message box to your patch and type "brgb 255 0 255" into it. Connect the message box to the left inlet of the lcd object, lock your patch, and click on the message box to see what happens.

So you now know how to figure out what the message want is, you know that it works, and you also know that changing the look of the lcd is going to involve finding a way to construct the message "brgb <int> <int> <int>" so that you can modify any or all of the three integer values.

This video will help you with that bit:
https://www.youtube.com/watch?v=8Kp82Fp6Jis

Roman Thilenius's icon

either by redrawing the shape all the time - which would be typical for working with lcd - or by using copymodes, jit.op, jit.alphabland, jit.-hue, jit.crossfade kind of stuff on the video output - given that your shape resides on a black or white background this should be really easy.