Hi all, I was trying to get a slider ( [hsl] ) to change color gradually as you drag it to the right. I'm using the RGB color subpatch from the slider help patch (inside subpatch 'editing') The strange thing is: when I drag the slider itself, it doesn't follow the RGB values, but it jumps between colors (the color presets I believe ?). When I use another slider to change the color of the first slider it does work... Any idea why? (see attached patch) gr, Tim
On Wed, 15 Dec 2010, tim vets wrote:
Hi all,I was trying to get a slider ( [hsl] ) to change color gradually as you drag it to the right. I'm using the RGB color subpatch from the slider help patch (inside subpatch 'editing') The strange thing is: when I drag the slider itself, it doesn't follow the RGB values, but it jumps between colors (the color presets I believe ?). When I use another slider to change the color of the first slider it does work... Any idea why? (see attached patch) gr, Tim
The problem is because you are not rounding the values to integers : thus the red bits bleed all over the green bits and blue bits.
You could also use [#to_iem], which is easy to use, and does this for you.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
2010/12/15 Mathieu Bouchard matju@artengine.ca
On Wed, 15 Dec 2010, tim vets wrote:
Hi all,I was trying to get a slider ( [hsl] ) to change color gradually as
you drag it to the right. I'm using the RGB color subpatch from the slider help patch (inside subpatch 'editing') The strange thing is: when I drag the slider itself, it doesn't follow the RGB values, but it jumps between colors (the color presets I believe ?). When I use another slider to change the color of the first slider it does work... Any idea why? (see attached patch) gr, Tim
The problem is because you are not rounding the values to integers : thus the red bits bleed all over the green bits and blue bits.
You could also use [#to_iem], which is easy to use, and does this for you.
Ah thanks, with an [int] in there it does seem to work too.
However, I still wonder what's the difference between that and using the other slider then? I also notice that when I change the multiplier to 280, the other slider starts flipping the colors as well. With the multiplier at 255, it does work, even though they are not integers either...? gr, Tim
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On Wed, 15 Dec 2010, tim vets wrote:
However, I still wonder what's the difference between that and using the other slider then? I also notice that when I change the multiplier to 280, the other slider starts flipping the colors as well. With the multiplier at 255, it does work, even though they are not integers either...?
Look, the formula is -1 - 65536*R - 256*G - B, where R,G,B are three whole numbers between 0 and 255 inclusively. If your colours are correct, it's because you do have whole numbers anyway, and if they are not, you have either fractions or out-of-range numbers.
If you wish, you can convert it back to RGB :
| [# inv+ -1] | [#outer >> (16 8 0)] | [# & 255] | [#color]
to help you see what's going on.
Your numberboxes are also too small to make you see the fractions.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC