Changing alpha with ColorTransform (hue + alpha)?

I am trying to change the alpha of the hue using the ColorTransform class, is it possible to do this?

private function setColor(target:DisplayObject, color:uint, alpha:uint = 150) {
            var colorTransform = new ColorTransform();
            colorTransform.color = color;
            colorTransform.alphaOffset = alpha;
            target.transform.colorTransform = colorTransform;
        }

However, when I try to use it, let's say

setColor(this, 0x333333, 100);

Does it seem like I'm getting a solid dark gray instead of a partially transparent hue?

+3
source share
1 answer

Use alpha alpha multiplier instead of alphaOffset. When you use alphaOffset, it adds alpha, so if alpha is already 100%, you will not see any transparency.

+5
source

All Articles