Forums > Jitter

easy? jit.lcd + swatch

February 19, 2009 | 5:08 pm

Hey all, I’m pretty new at Jitter and I thought this part was going to be easy… but it seems I was wrong. I’m trying to get the color swatch to talk to jit.lcd or just the regular lcd object in Max so that I can select a color and then draw lines with it (using the mouse and the moveto + lineto commands). Here is my trouble:

I know the swatch can be manipulated by sending it either HSL values or ARGB values, right now I have it set up to receive HSL values. I also know there are a few converter objects out there like jit.hsl2rgb. However, how do I tell swatch what kind of values to output? What is color index – both jit.lcd and the max lcd expect this kind of data when you use the color $1 message, and it doesn’t seem to match up to hsl or rgb (I select a color in swatch, start drawing and it ends up being a different color in the LCD), so I don’t know what kind of converter to use. Also, would I have to make a one dimensional matrix out of the color data from swatch to use one of jitter’s converter objects? Say I have swatch output ARGB data, would I want to input that into jit.matrix 4 char 1 1 in order to have a converter object process it?

Thank you for any help at all, I’ve been looking everywhere for this!
PS I don’t know anything about openGL yet, but I could go read up on it if this task is easier in jit.gl.sketch.


February 22, 2009 | 3:51 am

Hi Diane,

I was puzzled by swatch as well, until I realized that it uses an RGBA colorspace, while jitter matrices use ARGB. To get the correct color in a jitter matrix you just need to do something like this:

– Pasted Max Patch, click to expand. –

Best,
Zach


February 22, 2009 | 7:07 pm

Thanks!!! Got it.
-Diane


Viewing 3 posts - 1 through 3 (of 3 total)