Get actual color (uint) from other color using ColorTransform?

I am creating a ‘window’ using a class called Window (I know, pretty clever!). The window has a top title bar colored with a vertical gradient.

This is all part of a bigger user interface that starts with a theme color. Ultimately I want the window’s title bar gradient to be based on the theme color. Specifically, the window will get the theme color, and then the title bar’s gradient will go from one shade of the them color to another shade of the theme color.

I want to draw the titleBar’s gradient fill like this:

titleBar.graphics.beginGradientFill("linear", [lighten(themeColor, factor1), lighten(themeColor, factor2)], [1,1], [0,255], gradMatrix);

So my question is, what does the function lighten() have to do to themeColor using factor (and any other argument I might need to pass it) to return a lighter version of themeColor (uint)?

function lighten(color:uint, f):uint {
     // do something to color to get a value that's a lighter shade of color
}

So just to clarify, if I decide the theme color is blue, then the window’s title bar will automatically have a gradient using two light shades of blue. If I change the theme color to green, the title bar will change to two shades of green, accordingly.

I know how to use ColorTransform to change the color of an object. What I’m trying to do here, though, is not change the color of the object, but rather get a different color value to use to create the object.

You probably want to convert your RGB color uint to HSB, HSL, or HSV. Maybe using this HSBColor stuff from Flex: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/utils/HSBColor.html

For your factor values, you’d just want something in the 0-1, 0-100% range for your brightness value.