-
set color and brightness
I am dynamically setting color on my menu objects
Code:
SetWheelColor.newColor = "0x5B7CA7";
for(i=0;i<5;i++) {
myColor = new Color(menu["menu" + (i+1)]);
myColor.setRGB(SetWheelColor.newColor);
}
My question is ... how do I increase brightness dynamically for the five objects? I am looking for an instant effect - not a gradual change.
//Poden
-
set the rgb higher - there is no brightness script, unfortuately.
-
I believe i did it by cranking up the R, the G and the B by the same value.
cYa
-
Hey, Dork, you just slipped in between. But that's it indeed.
-
Thanks guys ...
But how do i do that dynamically?
//pod
-
myColor=new Color(yourClip);
myColor.setTransform(colorTransformObject);
colorTransformObject:
ra = perc. red (-100 to 100)
rb = offset red (-255 to 255)
ga = perc. green (-100 to 100)
gb = offset green (-255 to 255)
ba = perc. blue (-100 to 100)
bb = blue offset (-255 to 255)
aa = perc. alpha (-100 to 100)
ab = offset alpha (-255 to 255)
-
Yeah, thanks I got the colortransform object wich makes working with dynamic colors easy.
But how do i convert the hex-color into the colorTransformObject to be able to adjust values dynamically?
//pod
-
I got it!
- this code increases brightnes of "menu[i]" to the hex value in newcolor.
Code:
newColor = "0x5B7CA7";
rgb = newColor;
red = (rgb >> 16) & 0xFF;
green = (rgb >> 8) & 0xFF;
blue = rgb & 0xFF;
for(i=0;i<5;i++) {
factor = i * 20 - 40;
myColor = new Color(["menu" + (i+1)]);
myColor.setRGB(SetWheelColor.newColor);
brightness = new Color(menu["menu" + (i+1)]);
brightnessTransform = new Object( );
brightnessTransform.rb = red + factor;
brightnessTransform.gb = green + factor;
brightnessTransform.bb = blue + factor;
brightness.setTransform(brightnessTransform);
}
thx anyroad
//pod
-
-
see
http://proto.layer51.com/default.aspx
look at the color section there for some color functions. One there that might be useful is blendRGB() where you can take the color which the clip is currently and blend it with white by a t value of like .5 or something.
myColor.blendRGB(0xffffff, .5);