Forums > MaxMSP

What number is red?

Mar 03 2014 | 4:00 am


I’m trying to design a patch where the colour swatch position assigns a number. I’ve attached the patch, and would love some help with it please.





-- Pasted Max Patch, click to expand. --



Mar 04 2014 | 1:12 am

bump :)

Mar 04 2014 | 1:46 am

have a look at jit.colorspace, after doing the conversion from rgb to hls, you’ll need to unpack and then scale the h value to the range you want

Mar 04 2014 | 6:35 am

could I get an example please? Finding it complex to get head ’round.

Mar 04 2014 | 2:56 pm

examples are in the relevant help files:

Mar 05 2014 | 1:27 am


Thanks for pointing me to the helpfiles. Though. having trouble adapting them to my patch idea.. its a little beyond my grasp. Any examples or tweaks of my original patch would be really appreciated.

Mar 06 2014 | 12:54 am

The number of red? That depends on the flavor of Thursday and the time of corduroy. But if you’re just looking for the broad stroke, red primary is the first value of RGB of which the purest expression is 255 0 0, normalized as 1 0 0. But if you want just a number, then it would be 16,711,680 or 111111110000000000000000 binary. Unless you stick with hue, in which case it’s 0.

Here is the simplest way I know to get your patching going…

— Pasted Max Patch, click to expand. —
Mar 06 2014 | 1:18 am

If you have to use the actual output of swatch, you can convert RGB to hue and scale it to your index range. But the standard color conversion objects in max kinda suck (with the glorious exception of rgb2hsl and hsl2rgb in jit.pix). Here’s an rgb to hue patch that uses standard max objects and outputs accurate values.

— Pasted Max Patch, click to expand. —
Mar 10 2014 | 5:46 am

Cool thanks for the examples metamix- Really useful!

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

Forums > MaxMSP