When working with shapes which have a gradient, you would like to use a darker or lighter color of the first color as second color for the gradient. (Confusing I know).
So you can do this by adjusting the desired color in a color picker or you can do this by dint of a little AS3 function.
Select a color with the Color Picker and move the scroller to darken or to light the color:
Here is the function which makes your color darker or lighter. As arguments you have to pass the color and a value between -225(darker) and 255(lighter). This sounds plausible, I think so.
function colorTint(color:uint, tintValue:Number):Number { var colorTransform:ColorTransform = new ColorTransform(); colorTransform.color = color; colorTransform.redOffset = colorTransform.redOffset + tintValue < 0 ? 0 : colorTransform.redOffset + tintValue; if(colorTransform.redOffset > 255) colorTransform.redOffset = 255; colorTransform.greenOffset = colorTransform.greenOffset + tintValue < 0 ? 0 : colorTransform.greenOffset + tintValue; if(colorTransform.greenOffset > 255) colorTransform.greenOffset = 255; colorTransform.blueOffset = colorTransform.blueOffset + tintValue < 0 ? 0 : colorTransform.blueOffset + tintValue; if(colorTransform.blueOffset > 255) colorTransform.blueOffset = 255; return colorTransform.color; }
All the best,
Rafael





