On 03/02/2018 05:54 PM, José de Abreu wrote:> but for 0 to 255 rgb values, the math is simple, just divide this number
by 9/255 and discard the fractional part, then multiply by the position and sum all (it gives a number from 0 to 999)
With data structures, the color range for red, green, blue is from 0 to 8 respectively, so the whole spectrum is 0-888. A digit 9 equals digit 8 so 959 equals 858. So the calculation is * 8/255.
See here for a demo patch: https://forum.pdpatchrepo.info/topic/11085/how-to-convert-pd-s-color-numbers...
best, ingo