Welcome to %s forums

BrainModular Users Forum

Login Register

color numbers?

I need help on a Patch
Post Reply
woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 02 Dec 2008, 19:56

I'm trying to figure out how the color numbers work. I'd like to show a value range as a color from purple to red, and wondering what kind of math would be needed. the colors seem pretty random to me, but I'm sure they have some logic behind them. Just can't figure out what it is.

thanks!
-e
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 02 Dec 2008, 23:07

I agree that it can seem confusing, but I'm sure you'll recognize the numbers from colour selectors in other programs when you see the logic. The colours are coded with 24 bits/3 bytes where 0=black and 2^24-1=white. The lower byte is red, the middle is green and the upper is blue.

I created a little test patch with three faders (integer 0~255); the first (red) is taken as is, the second (green) is multiplied with 256, while the third (blue) is multiplied with 256*256=65536, and the result is added. With this example you would have the first fader at 255, the second (green) at 0, and move the third from 255 (a rather awful purple) and down to 0 get pure red.
Bjørn S

woodslanding
Member
Posts: 1327
Contact:

Unread post by woodslanding » 03 Dec 2008, 02:14

thanks--that is EXACTLY what I wanted to know!
Custom Ryzen 5900x MATX build, Win10, Fireface UFX, touchscreen
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests