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
color numbers?
-
woodslanding
- Member
- Posts: 1327
- Contact:
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.
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:
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
Custom 2 manual midi keyboard
Usine, Kontakt, Reaktor, Synthmaster, Byome, Arturia, Soundtoys, Unify
Who is online
Users browsing this forum: No registered users and 10 guests
